Add table.getn() for compatibility
This commit is contained in:
@@ -21,17 +21,17 @@ tryconcat( {} )
|
||||
-- insert, maxn
|
||||
print( '-- insert, maxn tests' )
|
||||
local t = { "one", "two", "three", a='aaa', b='bbb', c='ccc' }
|
||||
print( table.concat(t,'-'), table.maxn(t), #t )
|
||||
print( table.concat(t,'-'), table.maxn(t), #t, table.getn(t) )
|
||||
table.insert(t,'six')
|
||||
print( table.concat(t,'-'), table.maxn(t), #t )
|
||||
print( table.concat(t,'-'), table.maxn(t), #t, table.getn(t) )
|
||||
table.insert(t,1,'seven')
|
||||
print( table.concat(t,'-'), table.maxn(t), #t )
|
||||
print( table.concat(t,'-'), table.maxn(t), #t, table.getn(t) )
|
||||
table.insert(t,4,'eight')
|
||||
print( table.concat(t,'-'), table.maxn(t), #t )
|
||||
print( table.concat(t,'-'), table.maxn(t), #t, table.getn(t) )
|
||||
table.insert(t,7,'nine')
|
||||
print( table.concat(t,'-'), table.maxn(t), #t )
|
||||
print( table.concat(t,'-'), table.maxn(t), #t, table.getn(t) )
|
||||
table.insert(t,10,'ten')
|
||||
print( table.concat(t,'-'), table.maxn(t), #t )
|
||||
print( table.concat(t,'-'), table.maxn(t), #t, table.getn(t) )
|
||||
print( t[10] )
|
||||
print( table.maxn({}), #{} )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user