Add tests for the new features

Signed-off-by: Gavin Howard <gavin@yzena.com>
line_libs
Gavin Howard 1 year ago
parent dae8e5efa0
commit 601179321d
Signed by: gavin
GPG Key ID: C08038BDF280D33E
  1. 1
      tests/bc/all.txt
  2. 12
      tests/bc/leadingzero.txt
  3. 12
      tests/bc/leadingzero_results.txt
  4. 3
      tests/dc/errors.txt
  5. 15
      tests/other.sh

@ -49,3 +49,4 @@ recursive_arrays
divmod
modexp
bitfuncs
leadingzero

@ -0,0 +1,12 @@
plznl(0.01)
plznl(-0.01)
plznl(.01)
plznl(-.01)
plznl(1.01)
plznl(-1.01)
pnlznl(0.01)
pnlznl(-0.01)
pnlznl(.01)
pnlznl(-.01)
pnlznl(1.01)
pnlznl(-1.01)

@ -0,0 +1,12 @@
0.01
-0.01
0.01
-0.01
1.01
-1.01
.01
-.01
.01
-.01
1.01
-1.01

@ -24,6 +24,9 @@ zp198202389.289374pzp[He World!]xSzpzXfrfxzpfR
3 0~
0 _251^pR
.
ga
gb
gd
@
0 0< $
0 0> s e %

@ -75,12 +75,14 @@ if [ "$d" = "bc" ]; then
opt="x"
lopt="extended-register"
line_var="BC_LINE_LENGTH"
lltest="line_length()"
else
halt="q"
opt="l"
lopt="mathlib"
line_var="DC_LINE_LENGTH"
num="$num pR"
lltest="gcpR"
fi
# I use these, so unset them to make the tests work.
@ -251,6 +253,11 @@ printf '%s\n' "$num" | "$exe" "$@" -C > "$out2"
checktest "$d" "$?" "line length 3" "$out1" "$out2"
printf '0\n' > "$out1"
printf '%s\n' "$lltest" | "$exe" "$@" -C > "$out2"
checktest "$d" "$?" "line length 3" "$out1" "$out2"
printf 'pass\n'
printf '%s\n' "$numres" > "$out1"
@ -299,6 +306,14 @@ fi
printf '%s\n' "$data" | "$exe" "$@" -z > "$out2"
checktest "$d" "$?" "leading zero" "$out1" "$out2"
if [ "$d" = "bc" ] && [ "$extra_math" -ne 0 ]; then
printf '%s\n' "$halt" | "$exe" "$@" -lz "$testdir/bc/leadingzero.txt" > "$out2"
checktest "$d" "$?" "leading zero script" "$testdir/bc/leadingzero_results.txt" "$out2"
fi
"$exe" "$@" -f "saotehasotnehasthistohntnsahxstnhalcrgxgrlpyasxtsaosysxsatnhoy.txt" > /dev/null 2> "$out2"
err="$?"

Loading…
Cancel
Save