aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/test/nil_coalescing_spec.lua
blob: 90b2a649169c7698746be9467f236493c789c3a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
local _anon_func_0 = function(a, b)
	if a ~= nil then
		return a
	else
		return b
	end
end
local _anon_func_1 = function(a, c)
	if a ~= nil then
		return a
	else
		return c
	end
end
return describe("nil coalescing", function()
	return it("distinguish nil and false", function()
		local a = nil
		local b = false
		local c = 0
		assert.same((_anon_func_0(a, b)), false)
		return assert.same((_anon_func_1(a, c)), 0)
	end)
end)