* tuples.ch (setnmode); New module.

* tuples.exp:  Add some extra tests.
These are from PR 5024.
This commit is contained in:
Per Bothner 1995-03-06 22:11:17 +00:00
parent b73b413106
commit 3654c0672f
3 changed files with 39 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Mon Mar 6 14:11:01 1995 Per Bothner <bothner@kalessin.cygnus.com>
* tuples.ch (setnmode); New module.
* tuples.exp: Add some extra tests.
Sat Mar 4 15:16:17 1995 Per Bothner <bothner@kalessin.cygnus.com>
* callch.ch, callch.exp, Makefile.in: New test case.

View File

@ -31,3 +31,26 @@ DCL i INT;
i := 0;
END x;
setmode: MODULE /* This is from Cygnus PR chill/5024. */
NEWMODE day = SET( monday, tuesday, wednesday, thursday, friday, saturday, sunday );
NEWMODE dow = POWERSET day;
DCL d day;
DCL w dow;
printdow: PROC( w dow );
DCL d day;
DO FOR d in w;
WRITETEXT( stdout, "%C ", d );
OD;
END;
d := monday;
w := dow[monday : friday];
printdow( w );
printdow( dow[LOWER(dow) : UPPER(dow)] );
END setmode;

View File

@ -97,6 +97,17 @@ proc do_tests {} {
send "set v_arrbool(3 : 5) := \[ true, true, false \]\n"
expect -re "$prompt $"
gdb_test_exact "print v_arrbool" {= [(1): FALSE, (2:4): TRUE, (5): FALSE]} "v_arrbool after slice assignment 2"
# These tests are from Cygnus PR chill/5024:
send "break printdow\n" ; expect -re "$prompt $"
send "continue\n" ; expect -re "$prompt $"
send "set var w:= dow\[monday\]\n" ; expect -re "$prompt $"
test_print_accept "print w" "\\\[monday\\\]" \
"print bitstring after assignment"
send "set var w:=\[\]\n" ; expect -re "$prompt $"
test_print_accept "print w" "\\\[\\\]" \
"print bitstring after assignment of \[\]"
}
# Check to see if we have an executable to test. If not, then either we