1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
|
# expect/tcl code to test the das scanner
# jhrg
#
# $Log: scanner.b.exp,v $
# Revision 1.2 2002/06/03 22:21:16 jimg
# Merged with release-3-2-9
#
# Revision 1.1.54.1 2001/11/01 00:43:52 jimg
# Fixes to the scanners and parsers so that dataset variable names may
# start with digits. I've expanded the set of characters that may appear
# in a variable name and made it so that all except `#' may appear at
# the start. Some characters are not allowed in variables that appear in
# a DDS or CE while they are allowed in the DAS. This makes it possible
# to define containers with names like `COARDS:long_name.' Putting a colon
# in a variable name makes the CE parser much more complex. Since the set
# of characters that people want seems pretty limited (compared to the
# complete ASCII set) I think this is an OK approach. If we have to open
# up the expr.lex scanner completely, then we can but not without adding
# lots of action clauses to teh parser. Note that colon is just an example,
# there's a host of characters that are used in CEs that are not allowed
# in IDs.
#
# Revision 1.1 1996/07/16 16:54:42 jimg
# Added.
#
#
global comp_output # contains output from das-test_start
global verbose # this and srcdir are set by runtest.exp
global srcdir
set test_name scanner.b
set prompt "das-test:"
set timeout 2
set pass 1
das-test_start s
expect {
"${prompt} " {
}
timeout {
send_user "Timeout\n"
set pass 0
}
}
if {$pass} {
set thing "0\r\n"
send $thing
expect {
-re ".*WORD=${thing}${prompt} $" {
}
timeout {
send_user "Timeout\n"
set pass 0
}
}
}
if {$pass} {
set thing "01\r\n"
send $thing
expect {
-re ".*WORD=${thing}${prompt} $" {
}
timeout {
send_user "Timeout\n"
set pass 0
}
}
}
if {$pass} {
set thing "0123456789\r\n"
send $thing
expect {
-re ".*WORD=${thing}${prompt} $" {
}
timeout {
send_user "Timeout\n"
set pass 0
}
}
}
if {$pass} {
set thing "0123456789123456789123456789\r\n"
send $thing
expect {
-re ".*WORD=${thing}${prompt} $" {
}
timeout {
send_user "Timeout\n"
set pass 0
}
}
}
if {$pass} {
set thing "+999\r\n"
set thing2 "\\+999\r\n"
send $thing
expect {
-re ".*WORD=${thing2}${prompt} $" {
}
timeout {
send_user "Timeout\n"
set pass 0
}
}
}
if {$pass} {
set thing "-999\r\n"
send -- $thing
expect {
-re ".*WORD=${thing}${prompt} $" {
}
timeout {
send_user "Timeout\n"
set pass 0
}
}
}
if {$pass} {
set thing "+256\r\n"
set thing2 "\\+256\r\n"
send $thing
expect {
-re ".*WORD=${thing2}${prompt} $" {
}
timeout {
send_user "Timeout\n"
set pass 0
}
}
}
if {$pass} {
set thing "-256\r\n"
send -- $thing
expect {
-re ".*WORD=${thing}${prompt} $" {
}
timeout {
send_user "Timeout\n"
set pass 0
}
}
}
if {$pass} {
set thing "+255\r\n"
set thing2 "\\+255\r\n"
send $thing
expect {
-re ".*WORD=${thing2}${prompt} $" {
}
timeout {
send_user "Timeout\n"
set pass 0
}
}
}
if {$pass} {
set thing "-255\r\n"
send -- $thing
expect {
-re ".*WORD=${thing}${prompt} $" {
}
timeout {
send_user "Timeout\n"
set pass 0
}
}
}
if {$pass} {
pass $test_name
} else {
fail $test_name
}
das-test_exit
|