| 216 | } |
| 217 | |
| 218 | func 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 | |
| 235 | func TestInput_RemoveSpecialCharacter(t *testing.T) { |
| 236 | cleanString := New("special@#remove%%%%") |