From 17c76b66bb0da582d76d5f4e1072c25455cb3a9c Mon Sep 17 00:00:00 2001 From: James Turner Date: Tue, 12 Sep 2023 22:38:48 +0100 Subject: [PATCH] Nasal: add nil tests for ?? --- test_suite/unit_tests/Scripting/testNasalSys.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test_suite/unit_tests/Scripting/testNasalSys.cxx b/test_suite/unit_tests/Scripting/testNasalSys.cxx index 6aaf18080..ea68a59b5 100644 --- a/test_suite/unit_tests/Scripting/testNasalSys.cxx +++ b/test_suite/unit_tests/Scripting/testNasalSys.cxx @@ -328,6 +328,9 @@ void NasalSysTests::testNullishChain() unitTest.assert_equal(t ?? 99, 99); unitTest.assert_equal(s ?? 'default', 'abc'); unitTest.assert_equal(t ?? 'default', 'default'); + + # check 0 is used, only nil should fail + unitTest.assert_equal(0 ?? 'default', 0); )"); CPPUNIT_ASSERT(ok);