| 203 | } |
| 204 | |
| 205 | func 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 | |
| 218 | func TestInput_PadInvalidLength(t *testing.T) { |
| 219 | pad := New("Roshan") |