Files
sxchnge/backend/pkg/person/name_test.go
T

15 lines
373 B
Go

package person
import "testing"
func TestNameWithFallbackUsesFallbackPerField(t *testing.T) {
name := Name{FirstName: " Ivan "}
fallback := Name{FirstName: "FallbackFirst", LastName: " Ivanov "}
got := name.WithFallback(fallback)
want := Name{FirstName: "Ivan", LastName: "Ivanov"}
if got != want {
t.Fatalf("name mismatch: got=%+v want=%+v", got, want)
}
}