dc/tests/test_dreg
Marco Cetica 19ceac3e88
All checks were successful
dc / build (push) Successful in 15s
Added 'zR' option and fixed bug related to registers
2024-03-25 16:27:28 +01:00

16 lines
362 B
Bash

#!/bin/sh
utest() {
PROGRAM="$PWD/build/dc"
# Fill some values into the register
EXPECTED="4"
ACTUAL=$("$PROGRAM" -e '1 2 3 4 SA SA SA SA zA p')
assert_eq "$EXPECTED" "$ACTUAL"
# Test with empty register
EXPECTED="0"
ACTUAL=$("$PROGRAM" -e 'zA p')
assert_eq "$EXPECTED" "$ACTUAL"
}
# vim: ts=4 sw=4 softtabstop=4 expandtab: