calculator/tests/test_fmt.sh
2025-02-27 17:48:16 +10:00

39 lines
486 B
Bash

#!/bin/sh
test_count_digits() {
result=$("${QEMU}" -B 0x80000000 -s 2k tests/fmt_count_digits.elf)
expected=$(cat << END
00000001
00000001
00000001
00000001
00000001
00000002
00000002
00000002
00000003
00000003
00000004
0000000A
END
)
test $? -eq 0 && test "$result" = "$expected"
}
test_fmt_decimal() {
result=$("${QEMU}" -B 0x80000000 -s 2k tests/fmt_decimal.elf)
expected=$(cat << END
0
1
2
3
9
10
100
2147483648
END
)
test $? -eq 0 && test "$result" = "$expected"
}