MCPcopy Create free account
hub / github.com/austingebauer/go-leetcode / Test_isAnagram

Function Test_isAnagram

valid_anagram_242/solution_test.go:8–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

6)
7
8func Test_isAnagram(t *testing.T) {
9 type args struct {
10 s string
11 t string
12 }
13 tests := []struct {
14 name string
15 args args
16 want bool
17 }{
18 {
19 name: "is anagram",
20 args: args{
21 s: "anagram",
22 t: "nagaram",
23 },
24 want: true,
25 },
26 {
27 name: "is not anagram",
28 args: args{
29 s: "rat",
30 t: "car",
31 },
32 want: false,
33 },
34 }
35 for _, tt := range tests {
36 t.Run(tt.name, func(t *testing.T) {
37 assert.Equal(t, tt.want, isAnagram(tt.args.s, tt.args.t))
38 assert.Equal(t, tt.want, isAnagram0(tt.args.s, tt.args.t))
39 })
40 }
41}

Callers

nothing calls this directly

Calls 2

isAnagram0Function · 0.85
isAnagramFunction · 0.70

Tested by

no test coverage detected