Added test for ';X' function
dc / build (push) Successful in 35s Details

This commit is contained in:
Marco Cetica 2024-03-01 10:02:41 +01:00
parent 24b26d2154
commit 2f6abbec69
Signed by: marco
GPG Key ID: 45060A949E90D0FD
2 changed files with 22 additions and 0 deletions

14
tests/test_rarr Normal file
View File

@ -0,0 +1,14 @@
#!/bin/sh
utest() {
PROGRAM="$PWD/build/dc"
EXPECTED="500"
ACTUAL=$("$PROGRAM" -e '10 d 500 r :A ;A p')
assert_eq "$EXPECTED" "$ACTUAL"
# Test empty stack
EXPECTED="This operation requires one value"
ACTUAL=$("$PROGRAM" -e ';A' 2>&1) || true
assert_eq "$EXPECTED" "$ACTUAL"
}
# vim: ts=4 sw=4 softtabstop=4 expandtab:

8
tests/test_unr Normal file
View File

@ -0,0 +1,8 @@
#!/bin/sh
utest() {
EXPECTED="Unrecognized option"
ACTUAL=$("$PROGRAM" -e '(' 2>&1) || true
assert_eq "$EXPECTED" "$ACTUAL"
}
# vim: ts=4 sw=4 softtabstop=4 expandtab: