* tuples.ch. tuples.exp: Add new test for setting a variant record

using a tuple, and access the fields.
This commit is contained in:
Per Bothner 1995-09-27 18:51:33 +00:00
parent 4c2260aa5c
commit 658f132580
3 changed files with 19 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Wed Sep 27 11:51:50 1995 Per Bothner <bothner@kalessin.cygnus.com>
* tuples.ch. tuples.exp: Add new test for setting a variant record
using a tuple, and access the fields.
Thu Aug 3 10:45:37 1995 Fred Fish <fnf@cygnus.com>
* Update all FSF addresses except those in COPYING* files.

View file

@ -28,6 +28,15 @@ DCL j r1 := 4;
DCL i INT;
newmode vstruct = struct (a, b long,
case b of
(42): ch8 chars(20),
(52): i long
else ch1 char
esac);
DCL vstr vstruct := [ .a: 10, .b: 52, .i: 100 ];
i := 0;
END x;

View file

@ -38,7 +38,7 @@ proc do_tests {} {
send "set language chill\n" ; expect -re "$prompt $"
runto tuples.ch:31
runto tuples.ch:40
gdb_test_exact "print v_arri" {= [(1): -1, (2): -2, (3): -3, (4): -4, (5): -5]}
send "set v_arri := \[ 33, 44, 55, 66, 77 \]\n" ; expect -re "$prompt $"
@ -98,6 +98,10 @@ proc do_tests {} {
expect -re "$prompt $"
gdb_test_exact "print v_arrbool" {= [(1): FALSE, (2:4): TRUE, (5): FALSE]} "v_arrbool after slice assignment 2"
send "set vstr := \[ .a: 2+3, .b: 12, .ch1: 'x' \]\n"
expect -re "$prompt $"
gdb_test_exact "print vstr.a" {= 5} "vstr.a after assignment"
gdb_test_exact "print vstr.ch1" {= 'x'} "vstr.ch1 after assignment"
# These tests are from Cygnus PR chill/5024:
send "break printdow\n" ; expect -re "$prompt $"