Added more string replacements

This commit is contained in:
Dylan Araps
2018-06-15 08:43:35 +10:00
parent 49f91fa6f0
commit ac2b9e7ddf
2 changed files with 54 additions and 6 deletions

12
test.sh
View File

@@ -32,6 +32,16 @@ test_trim_quotes() {
assert_equals "$result" "test string"
}
test_strip_all() {
result="$(strip_all "The Quick Brown Fox" "[aeiou]")"
assert_equals "$result" "Th Qck Brwn Fx"
}
test_strip() {
result="$(strip "The Quick Brown Fox" "[aeiou]")"
assert_equals "$result" "Th Quick Brown Fox"
}
test_lstrip() {
result="$(lstrip "!:IHello" "!:I")"
assert_equals "$result" "Hello"
@@ -139,6 +149,8 @@ main() {
test_lower
test_upper
test_trim_quotes
test_strip_all
test_strip
test_lstrip
test_rstrip
test_reverse_array