22 lines
487 B
Bash
22 lines
487 B
Bash
#!/bin/sh
|
|
|
|
utest() {
|
|
PROGRAM="$PWD/build/dc"
|
|
EXPECTED="4"
|
|
ACTUAL=$("$PROGRAM" -e '5430 Z p')
|
|
assert_eq "$EXPECTED" "$ACTUAL"
|
|
|
|
# Test with floats
|
|
PROGRAM="$PWD/build/dc"
|
|
EXPECTED="4"
|
|
ACTUAL=$("$PROGRAM" -e '54.30 Z p')
|
|
assert_eq "$EXPECTED" "$ACTUAL"
|
|
|
|
# Test with strings
|
|
PROGRAM="$PWD/build/dc"
|
|
EXPECTED="11"
|
|
ACTUAL=$("$PROGRAM" -e '[ Hello World ] Z p')
|
|
assert_eq "$EXPECTED" "$ACTUAL"
|
|
}
|
|
# vim: ts=4 sw=4 softtabstop=4 expandtab:
|