MCPcopy Create free account
hub / github.com/gobeam/stringy / TestInput_PadInvalidLength

Function TestInput_PadInvalidLength

stringy_test.go:218–233  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

216}
217
218func TestInput_PadInvalidLength(t *testing.T) {
219 pad := New("Roshan")
220 if result := pad.Pad(6, "0", "both"); result != "Roshan" {
221 t.Errorf("Expected: %s but got: %s", "Roshan", result)
222 }
223 if result := pad.Pad(6, "0", "left"); result != "Roshan" {
224 t.Errorf("Expected: %s but got: %s", "Roshan", result)
225 }
226 if result := pad.Pad(6, "0", "right"); result != "Roshan" {
227 t.Errorf("Expected: %s but got: %s", "Roshan", result)
228 }
229
230 if result := pad.Pad(13, "0", "middle"); result != "Roshan" {
231 t.Errorf("Expected: %s but got: %s", "Roshan", result)
232 }
233}
234
235func TestInput_RemoveSpecialCharacter(t *testing.T) {
236 cleanString := New("special@#remove%%%%")

Callers

nothing calls this directly

Calls 2

NewFunction · 0.85
PadMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…