1
1
local hash = require (' github-theme.lib.hash' )
2
2
3
- describe (' Hash ' , function ()
3
+ describe (' hash() ' , function ()
4
4
it (' should produce same result with different table order' , function ()
5
5
local t1 = { Normal = { bg = ' #192330' , fg = ' #cdcecf' } }
6
6
local t2 = { Normal = { fg = ' #cdcecf' , bg = ' #192330' } }
7
- assert .is . same (hash (t1 ), hash (t2 ))
7
+ assert .same (hash (t1 ), hash (t2 ))
8
8
end )
9
9
10
10
it (' should understand booleans' , function ()
@@ -30,6 +30,27 @@ describe('Hash', function()
30
30
search = false ,
31
31
},
32
32
}
33
- assert .is_not .same (hash (t1 ), hash (t2 ))
33
+ assert .not_same (hash (t1 ), hash (t2 ))
34
+ end )
35
+
36
+ it (' should handle empty tables within (1)' , function ()
37
+ assert .not_same (hash ({}), hash ({ k = {} }))
38
+ assert .not_same (hash ({}), hash ({ key = {} }))
39
+ end )
40
+
41
+ -- TODO: FAILING
42
+ pending (' should handle empty tables within (2)' , function ()
43
+ assert .not_same (hash ({ k = 0 }), hash ({ k = {} }))
44
+ assert .not_same (hash ({ key = 0 }), hash ({ key = {} }))
45
+ end )
46
+
47
+ it (' should handle empty tables within (3)' , function ()
48
+ assert .not_same (hash ({ k = ' ' }), hash ({ k = {} }))
49
+ assert .not_same (hash ({ key = ' ' }), hash ({ key = {} }))
50
+ end )
51
+
52
+ it (' should handle empty tables within (4)' , function ()
53
+ assert .not_same (hash ({ k = false }), hash ({ k = {} }))
54
+ assert .not_same (hash ({ key = false }), hash ({ key = {} }))
34
55
end )
35
56
end )
0 commit comments