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

Function TestRotate

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

Source from the content-addressed store, hash-verified

884}
885
886func TestRotate(t *testing.T) {
887 t.Parallel()
888
889 assert := internal.NewAssert(t, "TestRotate")
890
891 tests := []struct {
892 input string
893 shift int
894 expected string
895 }{
896 {"", 1, ""},
897 {"a", 0, "a"},
898 {"a", 1, "a"},
899 {"a", -1, "a"},
900
901 {"Hello", -2, "lloHe"},
902 {"Hello", 1, "oHell"},
903 {"Hello, world!", 3, "ld!Hello, wor"},
904 }
905
906 for _, tt := range tests {
907 assert.Equal(tt.expected, Rotate(tt.input, tt.shift))
908 }
909}
910
911func TestTemplateReplace(t *testing.T) {
912 t.Parallel()

Callers

nothing calls this directly

Calls 3

EqualMethod · 0.95
NewAssertFunction · 0.92
RotateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…