aboutsummaryrefslogtreecommitdiff
path: root/tests/bc.test
blob: 65969b79c05b12bff7f7abc306e4a97695b2a197 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash

[ -f testing.sh ] && . testing.sh

#testcmd "name "args" "result" "infile" "stdin"

BDIR="$FILES/bc"
TESTDIR="./"

run_bc_test() {
	tst="$1"
	results=$(cat "$BDIR/${tst}_results.txt")
	testcmd "$tst" "-l $BDIR/$tst.txt" "$results\n" "$BDIR/$tst.txt" ""
}

run_bc_test decimal
run_bc_test add
run_bc_test subtract
run_bc_test multiply
run_bc_test divide
run_bc_test modulus
run_bc_test power
run_bc_test sqrt
run_bc_test vars
run_bc_test boolean
run_bc_test parse
run_bc_test print
run_bc_test exponent
run_bc_test log
run_bc_test pi
run_bc_test arctan
run_bc_test sine
run_bc_test cosine
run_bc_test bessel
run_bc_test arrays
run_bc_test misc
run_bc_test misc1
run_bc_test misc2

testcmd "stdin" "" "2\n" "" "1+1\n"