Added better split method

This commit is contained in:
Dylan Araps
2018-06-19 17:31:23 +10:00
parent d14cbe76f2
commit c24d0d1c5c
2 changed files with 39 additions and 8 deletions

View File

@@ -151,6 +151,11 @@ test_extract() {
rm test_file
}
test_split() {
IFS=$'\n' read -d "" -ra result < <(split "hello,world,my,name,is,john" ",")
assert_equals "${result[*]}" "hello world my name is john"
}
assert_equals() {
if [[ "$1" == "$2" ]]; then
((pass+=1))