• Home
  • Raw
  • Download

Lines Matching refs:t

63 func TestFirstUniqueStrings(t *testing.T) {
64 f := func(t *testing.T, imp func([]string) []string, in, want []string) {
65 t.Helper()
68 t.Errorf("incorrect output:")
69 t.Errorf(" input: %#v", in)
70 t.Errorf(" expected: %#v", want)
71 t.Errorf(" got: %#v", out)
76 t.Run("list", func(t *testing.T) {
77 f(t, firstUniqueStringsList, testCase.in, testCase.out)
79 t.Run("map", func(t *testing.T) {
80 f(t, firstUniqueStringsMap, testCase.in, testCase.out)
123 func TestLastUniqueStrings(t *testing.T) {
127 t.Errorf("incorrect output:")
128 t.Errorf(" input: %#v", testCase.in)
129 t.Errorf(" expected: %#v", testCase.out)
130 t.Errorf(" got: %#v", out)
135 func TestJoinWithPrefix(t *testing.T) {
161 t.Run(testCase.name, func(t *testing.T) {
164 t.Errorf("incorrect output:")
165 t.Errorf(" input: %#v", testCase.input)
166 t.Errorf(" prefix: %#v", prefix)
167 t.Errorf(" expected: %#v", testCase.expected)
168 t.Errorf(" got: %#v", out)
174 func TestIndexList(t *testing.T) {
200 t.Run(testCase.key, func(t *testing.T) {
203 t.Errorf("incorrect output:")
204 t.Errorf(" key: %#v", testCase.key)
205 t.Errorf(" input: %#v", input)
206 t.Errorf(" expected: %#v", testCase.expected)
207 t.Errorf(" got: %#v", out)
213 func TestInList(t *testing.T) {
231 t.Run(testCase.key, func(t *testing.T) {
234 t.Errorf("incorrect output:")
235 t.Errorf(" key: %#v", testCase.key)
236 t.Errorf(" input: %#v", input)
237 t.Errorf(" expected: %#v", testCase.expected)
238 t.Errorf(" got: %#v", out)
244 func TestPrefixInList(t *testing.T) {
266 t.Run(testCase.str, func(t *testing.T) {
269 t.Errorf("incorrect output:")
270 t.Errorf(" str: %#v", testCase.str)
271 t.Errorf(" prefixes: %#v", prefixes)
272 t.Errorf(" expected: %#v", testCase.expected)
273 t.Errorf(" got: %#v", out)
279 func TestFilterList(t *testing.T) {
286 t.Errorf("incorrect remainder output:")
287 t.Errorf(" input: %#v", input)
288 t.Errorf(" filter: %#v", filter)
289 t.Errorf(" expected: %#v", expected)
290 t.Errorf(" got: %#v", remainder)
295 t.Errorf("incorrect filtered output:")
296 t.Errorf(" input: %#v", input)
297 t.Errorf(" filter: %#v", filter)
298 t.Errorf(" expected: %#v", expected)
299 t.Errorf(" got: %#v", filtered)
303 func TestFilterListPred(t *testing.T) {
305 …AssertArrayString(t, "filter", FilterListPred([]string{"a/c", "b/a", "a/b"}, pred), []string{"a/c"…
306 …AssertArrayString(t, "filter", FilterListPred([]string{"b/c", "a/a", "b/b"}, pred), []string{"a/a"…
307 AssertArrayString(t, "filter", FilterListPred([]string{"c/c", "b/a", "c/b"}, pred), []string{})
308 …AssertArrayString(t, "filter", FilterListPred([]string{"a/c", "a/a", "a/b"}, pred), []string{"a/c"…
311 func TestRemoveListFromList(t *testing.T) {
317 t.Errorf("incorrect output:")
318 t.Errorf(" input: %#v", input)
319 t.Errorf(" filter: %#v", filter)
320 t.Errorf(" expected: %#v", expected)
321 t.Errorf(" got: %#v", out)
325 func TestRemoveFromList(t *testing.T) {
364 t.Run(testCase.name, func(t *testing.T) {
367 t.Errorf("incorrect output:")
368 t.Errorf(" key: %#v", testCase.key)
369 t.Errorf(" input: %#v", testCase.input)
370 t.Errorf(" expected: %#v", testCase.expectedFound)
371 t.Errorf(" got: %#v", found)
374 t.Errorf("incorrect output:")
375 t.Errorf(" key: %#v", testCase.key)
376 t.Errorf(" input: %#v", testCase.input)
377 t.Errorf(" expected: %#v", testCase.expectedOut)
378 t.Errorf(" got: %#v", out)
428 func TestSplitFileExt(t *testing.T) {
429 t.Run("soname with version", func(t *testing.T) {
433 t.Errorf("root should be %q but got %q", expected, root)
437 t.Errorf("suffix should be %q but got %q", expected, suffix)
441 t.Errorf("ext should be %q but got %q", expected, ext)
445 t.Run("soname with svn version", func(t *testing.T) {
449 t.Errorf("root should be %q but got %q", expected, root)
453 t.Errorf("suffix should be %q but got %q", expected, suffix)
457 t.Errorf("ext should be %q but got %q", expected, ext)
461 t.Run("version numbers in the middle should be ignored", func(t *testing.T) {
465 t.Errorf("root should be %q but got %q", expected, root)
469 t.Errorf("suffix should be %q but got %q", expected, suffix)
473 t.Errorf("ext should be %q but got %q", expected, ext)
477 t.Run("no known file extension", func(t *testing.T) {
481 t.Errorf("root should be %q but got %q", expected, root)
485 t.Errorf("suffix should be %q but got %q", expected, suffix)
488 t.Errorf("ext should be %q but got %q", expected, ext)
493 func Test_Shard(t *testing.T) {
553 t.Run(tt.name, func(t *testing.T) {
554 t.Run("strings", func(t *testing.T) {
556 t.Errorf("ShardStrings(%v, %v) = %v, want %v",
561 t.Run("paths", func(t *testing.T) {
584 t.Errorf("ShardPaths(%v, %v) = %v, want %v",