From: Alexandre Terrasa Date: Mon, 28 Nov 2016 21:11:38 +0000 (-0500) Subject: tests: test nitunit `NIT_TESTING_PATH` X-Git-Url: http://nitlanguage.org tests: test nitunit `NIT_TESTING_PATH` Signed-off-by: Alexandre Terrasa --- diff --git a/tests/nitunit.args b/tests/nitunit.args index f0bc3ee..6474d63 100644 --- a/tests/nitunit.args +++ b/tests/nitunit.args @@ -7,3 +7,4 @@ test_nitunit3 --no-color -o $WRITE test_nitunit_md.md --no-color -o $WRITE test_doc3.nit --no-color -o $WRITE test_nitunit4 --no-color -o $WRITE +test_nitunit5.nit --no-color -o $WRITE diff --git a/tests/sav/nitunit_args10.res b/tests/sav/nitunit_args10.res new file mode 100644 index 0000000..5fdb314 --- /dev/null +++ b/tests/sav/nitunit_args10.res @@ -0,0 +1,8 @@ +==== Test-suite of module test_nitunit5::test_nitunit5 | tests: 2 +[OK] test_nitunit5$TestNitunit5$test_path_is_set +[OK] test_nitunit5$TestNitunit5$test_path_is_suite_path + +Docunits: Entities: 4; Documented ones: 0; With nitunits: 0 +Test suites: Classes: 1; Test Cases: 2; Failures: 0 +[SUCCESS] All 2 tests passed. + \ No newline at end of file diff --git a/tests/test_nitunit5.nit b/tests/test_nitunit5.nit new file mode 100644 index 0000000..602648b --- /dev/null +++ b/tests/test_nitunit5.nit @@ -0,0 +1,29 @@ +# This file is part of NIT ( http://www.nitlanguage.org ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +module test_nitunit5 is test_suite + +import test_suite + +class TestNitunit5 + super TestSuite + + fun test_path_is_set do + assert "NIT_TESTING_PATH".environ != "" + end + + fun test_path_is_suite_path do + assert "NIT_TESTING_PATH".environ.basename == "test_nitunit5.nit" + end +end