* tuples.ch, tuples.exp: Exhance test cases (from PR 8643).

This commit is contained in:
Per Bothner 1995-12-12 00:55:18 +00:00
parent 339038710b
commit b44fe1d5e0
3 changed files with 64 additions and 0 deletions

View File

@ -1,3 +1,7 @@
Mon Dec 11 16:53:40 1995 Per Bothner <bothner@kalessin.cygnus.com>
* tuples.ch, tuples.exp: Exhance test cases (from PR 8643).
Mon Dec 11 06:57:07 1995 Wilfried Moser (Alcatel) <moser@rtl.cygnus.com>
* builtins.exp, pr-5016.{ch,exp}, result.{ch,exp},

View File

@ -63,3 +63,24 @@ printdow( w );
printdow( dow[LOWER(dow) : UPPER(dow)] );
END setmode;
PR8643: MODULE
SYNMODE m_set = SET (a, b, c, d);
SYNMODE m_ps = POWERSET m_set;
SYNMODE m_s1 = STRUCT (str CHARS(40) VARYING, i INT, ps m_ps);
DCL vs1 m_s1;
SYNMODE m_s2 = STRUCT (i LONG, s m_s1);
DCL vs2 m_s2;
SYNMODE m_arr = ARRAY (1:3) BYTE;
SYNMODE m_s3 = STRUCT (i LONG, a m_arr);
DCL vs3 m_s3;
DCL i LONG;
i := 24;
END PR8643;

View File

@ -122,6 +122,45 @@ proc do_tests {} {
send "set var w:=\[\]\n" ; expect -re "$prompt $"
gdb_test "print w" " = \\\[\\\]" \
"print bitstring after assignment of \[\]"
# These tests are from Cygnus PR chill/8643:
runto tuples.ch:40
send "set var vs1 := \[ \"foo\", 41, \[ b \] \]\n" ; expect -re "$prompt $"
gdb_test_exact "print vs1" { = [.str: "foo", .i: 41, .ps: [b]]} \
"print vs1 after tuple assign 1"
send "set var vs1 := \[ \"bar\", 42, m_ps\[ a \] \]\n"
expect -re "$prompt $"
gdb_test_exact "print vs1" { = [.str: "bar", .i: 42, .ps: [a]]} \
"print vs1 after tuple assign 2"
send "set var \$i := m_s1\[\"foo\", 42, \[a \]\]\n"
expect -re "$prompt $"
gdb_test_exact {print $i} { = [.str: "foo", .i: 42, .ps: [a]]} \
"print \$i after tuple assign 1"
send "set var \$i := m_s1\[\"foo\", 44, m_ps\[a \]\]\n"
expect -re "$prompt $"
gdb_test_exact {print $i} { = [.str: "foo", .i: 44, .ps: [a]]} \
"print \$i after tuple assign 2"
send "set var vs2 := \[ 10, \[ \"foo\" , 42, \[ b \] \] \]\n"
expect -re "$prompt $"
gdb_test_exact "print vs2" \
{ = [.i: 10, .s: [.str: "foo", .i: 42, .ps: [b]]]} \
"print vs2 after tuple assign 1"
send "set var vs2 := \[ 10+3, m_s1\[ \"foo\" , 42, m_ps\[ b \] \] \]\n"
expect -re "$prompt $"
gdb_test_exact "print vs2" \
{ = [.i: 13, .s: [.str: "foo", .i: 42, .ps: [b]]]} \
"print vs2 after tuple assign 1"
send "set var vs3 := \[ 33, \[ -1, -2, -3 \] \]\n" ; expect -re "$prompt $"
gdb_test_exact "print vs3" {[.i: 33, .a: [(1): -1, (2): -2, (3): -3]]} \
"print vs3 after tuple assign"
send "set var \$k := m_s3\[ 33, m_arr\[ 4, 3, 2 \] \]\n"
expect -re "$prompt $"
gdb_test_exact {print $k} { = [.i: 33, .a: [(1): 4, (2): 3, (3): 2]]} \
"print \$k after tuple assign"
}
do_tests