diff --git a/test_suite/unit_tests/Scripting/testNasalSys.cxx b/test_suite/unit_tests/Scripting/testNasalSys.cxx index d536a8958..08acc2dae 100644 --- a/test_suite/unit_tests/Scripting/testNasalSys.cxx +++ b/test_suite/unit_tests/Scripting/testNasalSys.cxx @@ -227,3 +227,17 @@ void NasalSysTests::testRoundFloor() )"); CPPUNIT_ASSERT(ok); } + +void NasalSysTests::testRange() +{ + auto nasalSys = globals->get_subsystem<FGNasalSys>(); + nasalSys->getAndClearErrorList(); + + bool ok = FGTestApi::executeNasal(R"( + unitTest.assert_equal(range(5), [0, 1, 2, 3, 4]); + unitTest.assert_equal(range(2, 8), [2, 3, 4, 5, 6, 7]); + unitTest.assert_equal(range(2, 10, 3), [2, 5, 8]); + + )"); + CPPUNIT_ASSERT(ok); +} diff --git a/test_suite/unit_tests/Scripting/testNasalSys.hxx b/test_suite/unit_tests/Scripting/testNasalSys.hxx index 256bab50e..036a5bbbd 100644 --- a/test_suite/unit_tests/Scripting/testNasalSys.hxx +++ b/test_suite/unit_tests/Scripting/testNasalSys.hxx @@ -36,6 +36,7 @@ class NasalSysTests : public CppUnit::TestFixture CPPUNIT_TEST(testAirportGhost); CPPUNIT_TEST(testCompileLarge); CPPUNIT_TEST(testRoundFloor); + CPPUNIT_TEST(testRange); CPPUNIT_TEST_SUITE_END(); public: @@ -51,6 +52,7 @@ public: void testAirportGhost(); void testCompileLarge(); void testRoundFloor(); + void testRange(); }; #endif // _FG_NASALSYS_UNIT_TESTS_HXX