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

Function TestInput_Pad

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

Source from the content-addressed store, hash-verified

203}
204
205func TestInput_Pad(t *testing.T) {
206 pad := New("Roshan")
207 if result := pad.Pad(10, "0", "both"); result != "00Roshan00" {
208 t.Errorf("Expected: %s but got: %s", "00Roshan00", result)
209 }
210 if result := pad.Pad(10, "0", "left"); result != "0000Roshan" {
211 t.Errorf("Expected: %s but got: %s", "0000Roshan", result)
212 }
213 if result := pad.Pad(10, "0", "right"); result != "Roshan0000" {
214 t.Errorf("Expected: %s but got: %s", "Roshan0000", result)
215 }
216}
217
218func TestInput_PadInvalidLength(t *testing.T) {
219 pad := New("Roshan")

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…