diff options
author | Steve Bennett <steveb@workware.net.au> | 2020-12-19 09:31:40 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2020-12-26 18:08:29 +1000 |
commit | ea1b12824f360ca2f3b4838e1d88605b9b1c1a6d (patch) | |
tree | da9cc972a7fedcfe45eaa068636345013c785d12 /tests/pack.test | |
parent | a905122e48ae2f5208b037d8bfc08631b753cb63 (diff) | |
download | jimtcl-ea1b12824f360ca2f3b4838e1d88605b9b1c1a6d.zip jimtcl-ea1b12824f360ca2f3b4838e1d88605b9b1c1a6d.tar.gz jimtcl-ea1b12824f360ca2f3b4838e1d88605b9b1c1a6d.tar.bz2 |
core: support integer expressions in various commands
For convenience, many commands now accept integer expressions
rather than only simple integers.
These are:
loop, range, incr, string repeat, lrepeat, pack, unpack, rand
This simplifies many cases where previously expr {} or $() was required.
e.g.
foreach i [range 4+1 2*$b] { ... }
string repeat 2**$n a
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests/pack.test')
-rw-r--r-- | tests/pack.test | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/pack.test b/tests/pack.test index d059087..0746e44 100644 --- a/tests/pack.test +++ b/tests/pack.test @@ -12,7 +12,7 @@ test pack-1.2 {pack invalid type} -body { test pack-1.3 {pack bad width} -body { pack a 1 -intbe badint -} -returnCodes error -result {expected integer but got "badint"} +} -returnCodes error -match glob -result {expected integer *but got "badint"} test pack-1.4 {pack bad width} -body { pack a 1 -intbe -5 @@ -20,7 +20,7 @@ test pack-1.4 {pack bad width} -body { test pack-1.5 {pack bad offset} -body { pack a 1 -intbe 5 badint -} -returnCodes error -result {expected integer but got "badint"} +} -returnCodes error -match glob -result {expected integer *but got "badint"} test pack-1.6 {pack bad offset} -body { pack a 1 -intbe 5 -6 @@ -78,7 +78,7 @@ test unpack-1.2 {unpack invalid type} -body { test unpack-1.3 {unpack bad width} -body { unpack abc -intle 0 badint -} -returnCodes error -result {expected integer but got "badint"} +} -returnCodes error -match glob -result {expected integer *but got "badint"} test unpack-1.4 {unpack bad width} -body { unpack abc -intle 0 -5 @@ -86,7 +86,7 @@ test unpack-1.4 {unpack bad width} -body { test unpack-1.5 {unpack bad offset} -body { unpack abc -intle badint 8 -} -returnCodes error -result {expected integer but got "badint"} +} -returnCodes error -match glob -result {expected integer *but got "badint"} test unpack-1.6 {unpack bad offset} -body { unpack abc -intle -6 8 |