diff --git a/manuals/development.md b/manuals/development.md index c15c42ad..d6c86476 100644 --- a/manuals/development.md +++ b/manuals/development.md @@ -2496,6 +2496,13 @@ array.bc : Tests arrays even harder than the arrays standard test. +array2.bc + +: Implements a test where an array element is passed as a parameter to a + function, and then another array is passed to a later parameter that is + named the same as the first array. This was added because of a bug found + while writing a script in bc. + atan.bc : Tests arctangent even harder than the arctangent standard test. diff --git a/tests/bc/scripts/all.txt b/tests/bc/scripts/all.txt index b4a17878..e2d2aa32 100644 --- a/tests/bc/scripts/all.txt +++ b/tests/bc/scripts/all.txt @@ -5,6 +5,7 @@ add.bc print.bc parse.bc array.bc +array2.bc atan.bc bessel.bc functions.bc diff --git a/tests/bc/scripts/array2.bc b/tests/bc/scripts/array2.bc new file mode 100644 index 00000000..3e4e6832 --- /dev/null +++ b/tests/bc/scripts/array2.bc @@ -0,0 +1,20 @@ +#! /usr/bin/bc -q + +define z(x, a[]) { + return x + a[1] +} + +define y(x, b[]) { + return x + b[1] +} + +a[0] = 5 +a[1] = 6 + +b[0] = 8 +b[1] = 7 + +z(a[0], b[]) +y(b[0], a[]) + +halt diff --git a/tests/bc/scripts/array2.txt b/tests/bc/scripts/array2.txt new file mode 100644 index 00000000..76dcb035 --- /dev/null +++ b/tests/bc/scripts/array2.txt @@ -0,0 +1,2 @@ +12 +14