this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/filetypes: fix TestParseFile tests

These tests were disabled. Fix the error messages and reenable.

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: Ibb399f3b9474cd5dd4f7043fa5638529aaf50c4e
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/542989
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>

+4 -6
+4 -6
internal/filetypes/filetypes_test.go
··· 29 29 if err != nil { 30 30 x = errors.String(err.(errors.Error)) 31 31 } 32 - if diff := cmp.Diff(x, want, cmpopts.EquateEmpty()); diff != "" { 33 - t.Error(diff) 32 + if diff := cmp.Diff(want, x, cmpopts.EquateEmpty()); diff != "" { 33 + t.Errorf("unexpected result; -want +got\n%s", diff) 34 34 } 35 35 } 36 36 ··· 252 252 } 253 253 254 254 func TestParseFile(t *testing.T) { 255 - t.Skip("fix error messages") 256 255 // TODO(errors): wrong path? 257 - 258 256 testCases := []struct { 259 257 in string 260 258 mode Mode ··· 311 309 }, 312 310 }, { 313 311 in: "foo:file.bar", 314 - out: `cue: marshal error: tags: value "foo" not found`, 312 + out: `unknown filetype foo`, 315 313 }, { 316 314 in: "file.bar", 317 - out: `cue: marshal error: extensions: value ".bar" not found`, 315 + out: `unknown file extension .bar`, 318 316 }} 319 317 for _, tc := range testCases { 320 318 t.Run(tc.in, func(t *testing.T) {