Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f2a8bca

Browse files
author
Openset
committed
Add: test case
1 parent 37b662d commit f2a8bca

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

‎problems/buddy-strings/buddy_strings_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ func TestBuddyStrings(t *testing.T) {
1515
b: "ba",
1616
expected: true,
1717
},
18+
{
19+
a: "aa",
20+
b: "aa",
21+
expected: true,
22+
},
1823
{
1924
a: "ab",
2025
b: "ab",
@@ -30,6 +35,16 @@ func TestBuddyStrings(t *testing.T) {
3035
b: "aa",
3136
expected: false,
3237
},
38+
{
39+
a: "hello",
40+
b: "h0lle",
41+
expected: false,
42+
},
43+
{
44+
a: "hello",
45+
b: "hanna",
46+
expected: false,
47+
},
3348
}
3449
for _, tc := range tests {
3550
output := buddyStrings(tc.a, tc.b)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /