Nasal: add nil tests for ??
This commit is contained in:
parent
bb34c0514a
commit
17c76b66bb
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue