1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
package approvaltests
import (
"strings"
"testing"
)
func Test00(t *testing.T) {
approvalName, err := getApprovalName()
if err != nil {
t.Fatalf("%s", err)
}
approvalFile := approvalName.getApprovalFile(".txt")
assertEndsWith(approvalFile, "namer_test.Test00.approved.txt", t)
receivedFile := approvalName.getReceivedFile(".txt")
assertEndsWith(receivedFile, "namer_test.Test00.received.txt", t)
}
func assertEndsWith(s string, ending string, t *testing.T) {
if !strings.HasSuffix(s, ending) {
t.Fatalf("expected name to be '%s', but got %s", ending, s)
}
}
|