robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Justin M. KeyesMerge #40865 from justinmk/fixcif907614088

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