bash-fun/test/list_test.sh
Sławomir Śledź f254b98a3f Add more tests
2018-02-13 23:29:46 +01:00

25 lines
No EOL
299 B
Bash
Executable file

#! /bin/bash
testListFromOneElement() {
assertEquals 1 $(list 1)
}
testListFromEmpty() {
assertEquals "" "$(list)"
}
testListUnlist() {
assertEquals "1 3 6" "$(list 1 3 6 | unlist)"
}
testList() {
list=$(cat <<EOF
1
3
6
EOF
)
assertEquals "$list" "$(list 1 3 6)"
}
. ./shunit2-init.sh