MCPcopy
hub / github.com/duke-git/lancet / TestConcat

Function TestConcat

strutil/string_test.go:826–847  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

824}
825
826func TestConcat(t *testing.T) {
827 t.Parallel()
828
829 assert := internal.NewAssert(t, "TestConcat")
830
831 tests := []struct {
832 args []string
833 expected string
834 }{
835 {[]string{}, ""},
836 {[]string{"a"}, "a"},
837 {[]string{"a", "b"}, "ab"},
838 {[]string{"a", "b", "c"}, "abc"},
839 {[]string{"a", "", "b", "c", ""}, "abc"},
840 {[]string{"你好", ",", "", "世界!", ""}, "你好,世界!"},
841 {[]string{"Hello", " Wo", "r", "ld!", ""}, "Hello World!"},
842 }
843
844 for _, tt := range tests {
845 assert.Equal(tt.expected, Concat(0, tt.args...))
846 }
847}
848
849func TestEllipsis(t *testing.T) {
850 t.Parallel()

Callers

nothing calls this directly

Calls 3

EqualMethod · 0.95
NewAssertFunction · 0.92
ConcatFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…