MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / TestTable

Function TestTable

strings/kmp/kmp_test.go:38–62  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

36}
37
38func TestTable(t *testing.T) {
39 type args struct {
40 w string
41 }
42 tests := []struct {
43 name string
44 args args
45 want []int
46 }{
47 {
48 name: "test1",
49 args: args{
50 w: "ababacaab",
51 },
52 want: []int{-1, 0, 0, 1, 2, 3, 0, 1, 1},
53 },
54 }
55 for _, tt := range tests {
56 t.Run(tt.name, func(t *testing.T) {
57 if got := table(tt.args.w); !reflect.DeepEqual(got, tt.want) {
58 t.Errorf("Table() = %v, want %v", got, tt.want)
59 }
60 })
61 }
62}

Callers

nothing calls this directly

Calls 1

tableFunction · 0.85

Tested by

no test coverage detected