testsuite: add bc and dc tests

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2018-12-12 21:41:40 +01:00
parent d6ad3666dc
commit 9a23b07c4c
77 changed files with 5466 additions and 0 deletions

35
testsuite/bc_array.bc Normal file
View File

@ -0,0 +1,35 @@
#! /usr/bin/bc -q
define z(a[]) {
for (i = 0; i < l; ++i) {
a[i]
}
}
define x(a[]) {
for (i = 0; i < l; ++i) {
a[i] = -i
}
z(a[])
}
for (i = 0; i < 101; ++i) {
a[i] = i
}
a[104] = 204
l = length(a[])
for (i = 0; i <= l; ++i) {
a[i]
}
z(a[])
x(a[])
z(a[])
l
halt