-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(linter): golangci-lint v1.61.0 compatibility #334
base: main
Are you sure you want to change the base?
Changes from all commits
989fc92
d491ef1
59720a0
434cc18
6da3d3d
5b72a13
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package ui | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestConcatStringsSingleString(t *testing.T) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looping through input, expected tuples and doing assert in a sub-test would also work, as all tests have the same check, but no big difference. |
||
result := ConcatStrings("hello") | ||
expected := "hello" | ||
if result != expected { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
t.Errorf("expected %s, got %s", expected, result) | ||
} | ||
} | ||
|
||
func TestConcatStringsMultipleStrings(t *testing.T) { | ||
result := ConcatStrings("hello", "world", "foo", "bar") | ||
expected := "hello/world/foo/bar" | ||
if result != expected { | ||
t.Errorf("expected %s, got %s", expected, result) | ||
} | ||
} | ||
|
||
func TestConcatStringsWithEmptyStrings(t *testing.T) { | ||
result := ConcatStrings("hello", "", "world", "", "foo", "bar") | ||
expected := "hello/world/foo/bar" | ||
if result != expected { | ||
t.Errorf("expected %s, got %s", expected, result) | ||
} | ||
} | ||
|
||
func TestConcatStringsAllEmptyStrings(t *testing.T) { | ||
result := ConcatStrings("", "", "") | ||
expected := "" | ||
if result != expected { | ||
t.Errorf("expected %s, got %s", expected, result) | ||
} | ||
} | ||
|
||
func TestConcatStringsEmptyInput(t *testing.T) { | ||
result := ConcatStrings() | ||
expected := "" | ||
if result != expected { | ||
t.Errorf("expected %s, got %s", expected, result) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there
Sprint
method available? If yes, the extra string as string format could be omitted 🤔