* chillvars.exp, string.exp: New tests for LOWER/UPPER/LENGTH

This commit is contained in:
Per Bothner 1995-06-14 20:05:59 +00:00
parent 6137983598
commit a055dacb68
3 changed files with 23 additions and 0 deletions

View File

@ -1,3 +1,7 @@
Wed Jun 14 13:07:45 1995 Per Bothner <bothner@kalessin.cygnus.com>
* chillvars.exp, string.exp: New tests for LOWER/UPPER/LENGTH.
Wed Jun 7 17:52:38 1995 Per Bothner <bothner@kalessin.cygnus.com>
* chillvars.ch (xptr): Declare new variable.

View File

@ -83,6 +83,9 @@ proc test_CHAR {} {
gdb_test "ptype printable_char" "type = (CHAR|char)"
gdb_test "whatis printable_char" "type = (CHAR|char)"
gdb_test "print printable_char" " = 'a'"
gdb_test "print lower(char)" " = C'00'"
gdb_test "print upper(char)" " = C'ff'"
}
proc test_BYTE {} {
@ -92,6 +95,11 @@ proc test_BYTE {} {
gdb_test "ptype byte_high" "type = (BYTE|byte)"
gdb_test "whatis byte_high" "type = (BYTE|byte)"
gdb_test "print byte_high" " = 127"
gdb_test "print lower(byte)" " = -128"
gdb_test "print upper(byte)" " = 127"
gdb_test "print lower(byte_high)" " = -128"
gdb_test "print upper(byte_high)" " = 127"
}
proc test_UBYTE {} {
@ -241,6 +249,10 @@ proc test_arrays {} {
gdb_test "ptype longrealtable2" "type = ARRAY \\(+5:9\\)+ (DOUBLE|double)"
gdb_test_exact "print longrealtable2" \
{= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
gdb_test "print length(longrealtable2)" {= 5}
gdb_test "print lower(longrealtable2)" {= 5}
gdb_test "print upper(longrealtable2)" {= 9}
}
proc test_strings {} {

View File

@ -46,6 +46,13 @@ proc do_tests {} {
gdb_test "p s10(1)" { = '2'} "print string element"
gdb_test "p s10(1:3)" { = "234"} "print string slice (:)"
gdb_test "p s10(2 up 3)" { = "345"} "print string slice (up)"
gdb_test "p length(s10)" { = 10} "print string length"
gdb_test "p length(s20)" { = 14} "print varying string length"
gdb_test "p lower(s10)" { = 0} "print string lower"
gdb_test "p upper(s10)" { = 9} "print string upper"
gdb_test "p lower(s20)" { = 0} "print varying string lower"
gdb_test "p upper(s20)" { = 19} "print varying string upper"
}
# Check to see if we have an executable to test. If not, then either we