From ea1b12824f360ca2f3b4838e1d88605b9b1c1a6d Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Sat, 19 Dec 2020 09:31:40 +1000 Subject: 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 --- tests/pack.test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/pack.test') 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 -- cgit v1.1