2018-01-24 16:22:48 -05:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
testDrop9From10() {
|
2020-12-14 10:08:36 -05:00
|
|
|
assertEquals 10 $(list {1..10} | list_drop 9)
|
2018-01-24 16:22:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
testDrop8From10() {
|
2020-12-14 10:08:36 -05:00
|
|
|
assertEquals "9 10" "$(list {1..10} | list_drop 8 | unlist)"
|
2018-01-24 16:22:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
testDropAll() {
|
2020-12-14 10:08:36 -05:00
|
|
|
assertEquals "" "$(list {1..10} | list_drop 10)"
|
2018-01-24 16:22:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
testDropMoreThanAvailable() {
|
2020-12-14 10:08:36 -05:00
|
|
|
assertEquals "" "$(list {1..10} | list_drop 15)"
|
2018-01-24 16:22:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
testDropZero() {
|
2020-12-14 10:08:36 -05:00
|
|
|
assertEquals "1 2 3 4 5 6 7 8 9 10" "$(list {1..10} | list_drop 0 | unlist)"
|
2018-01-24 16:22:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
. ./shunit2-init.sh
|