From 9f9d8872db3525dc1285060ced3f5381dd8122e7 Mon Sep 17 00:00:00 2001 From: James Roseborough Date: Thu, 7 Aug 2008 21:10:23 +0000 Subject: [PATCH] Add misc table tests. --- src/test/res/table.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/res/table.lua b/src/test/res/table.lua index 306f64ab..9aec1d19 100644 --- a/src/test/res/table.lua +++ b/src/test/res/table.lua @@ -160,3 +160,10 @@ print('a..',unpack({a('a', nil, nil)})) print('.b.',unpack({a(nil, 'b', nil)})) print('...',unpack({a(nil, nil, nil)})) +-- misc tests +print( # { 'abc', 'def', 'ghi', nil } ) -- should be 3 ! +print( # { 'abc', 'def', 'ghi', false } ) -- should be 4 ! +print( # { 'abc', 'def', 'ghi', 0 } ) -- should be 4 ! +print( nil and 'T' or 'F' ) -- should be 'F' +print( false and 'T' or 'F' ) -- should be 'F' +print( 0 and 'T' or 'F' ) -- should be 'T'