nitunit: use `test` annotation for propdefs
authorAlexandre Terrasa <alexandre@moz-code.org>
Tue, 6 Jun 2017 01:02:21 +0000 (21:02 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Tue, 15 Aug 2017 18:12:16 +0000 (14:12 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

src/testing/testing_suite.nit

index 28ed4f2..1948b3a 100644 (file)
@@ -54,7 +54,7 @@ class NitUnitTester
                                if not case_match_pattern(mpropdef) then continue
                                toolcontext.modelbuilder.total_tests += 1
                                var test = new TestCase(suite, mpropdef, toolcontext)
-                               suite.add_test test
+                               suite.test_cases.add test
                        end
                end
                # method to execute after all tests in the module
@@ -114,9 +114,6 @@ class TestSuite
        # List of `TestCase` to be executed in this suite.
        var test_cases = new Array[TestCase]
 
-       # Add a `TestCase` to the suite.
-       fun add_test(case: TestCase) do test_cases.add case
-
        # Test to be executed before the whole test suite.
        var before_module: nullable TestCase = null
 
@@ -376,12 +373,6 @@ class TestCase
 end
 
 redef class MMethodDef
-       # TODO use annotations?
-
-       # Is the method a test_method?
-       # i.e. begins with "test_"
-       private fun is_test: Bool do return name.has_prefix("test_")
-
        # Is the method a "before_module"?
        private fun is_before_module: Bool do return name == "before_module"