1
0
Fork 0

Nasal: add nil tests for ??

This commit is contained in:
James Turner 2023-09-12 22:38:48 +01:00
parent bb34c0514a
commit 17c76b66bb

View file

@ -328,6 +328,9 @@ void NasalSysTests::testNullishChain()
unitTest.assert_equal(t ?? 99, 99); unitTest.assert_equal(t ?? 99, 99);
unitTest.assert_equal(s ?? 'default', 'abc'); unitTest.assert_equal(s ?? 'default', 'abc');
unitTest.assert_equal(t ?? 'default', 'default'); unitTest.assert_equal(t ?? 'default', 'default');
# check 0 is used, only nil should fail
unitTest.assert_equal(0 ?? 'default', 0);
)"); )");
CPPUNIT_ASSERT(ok); CPPUNIT_ASSERT(ok);