robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f907614088
master
1local assert =require ( 'test.assert' ) 2local t =require ( 'test.testutil' ) 3 4local describe , it =t . describe , t . it 5describe ( 'test.assert' , function () 6it ( 'ignores aliasing differences' , function () 7local shared ={} 8 9assert . eq ( { 1 , shared , 1 , shared } , { 1 , {} , 1 , {} } ) 10assert . eq ( { 1 , {} , 1 , {} } , { 1 , shared , 1 , shared } ) 11end ) 12 13it ( 'handles cyclic tables' , function () 14local expected ={} 15local actual ={} 16 17expected [ 1 ] =expected 18actual [ 1 ] =actual 19 20assert . eq ( expected , actual ) 21end ) 22 23it ( 'still rejects different structures' , function () 24local expected ={} 25 26expected [ 1 ] =expected 27 28assert . neq ( expected , { {} } ) 29end ) 30end )