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

16 lines
No EOL
268 B
Bash
Executable file

#! /bin/bash
testLastFromList() {
assertEquals 10 $(list {1..10} | last)
assertEquals 7 $(list 5 6 7 | last)
}
testLastFromOneElementList() {
assertEquals 1 $(list 1 | last)
}
testLastFromEmptyList() {
assertEquals "" "$(list | last)"
}
. ./shunit2-init.sh