Merge: nitunit: use annotations
authorJean Privat <jean@pryen.org>
Mon, 25 Sep 2017 20:23:07 +0000 (16:23 -0400)
committerJean Privat <jean@pryen.org>
Mon, 25 Sep 2017 20:23:07 +0000 (16:23 -0400)
This PR replace the name heuristics used by nitunit by nice and tidy annotations.

Before:

~~~nit
module test_my_test is test_suite

import test_suite

class TestMyTest
    super TestSuite

    redef fun before do # something

    fun test_my_test do
        assert true
    end
end
~~~

After:

~~~nit
module my_test is test

class MyTest
    test

    fun setup is before do # something

    fun my_test is test do
        assert true
    end
end
~~~

Motivations:
* cleaner API / naming policy
* [BDD](https://en.wikipedia.org/wiki/Behavior-driven_development) friendly
* more flexibility as one can define a `after` method in the lib that will only be executed on children module tagged with `test`
* more extensible as one can improve nitunit to support `test(timeout = 150)` or `test(res= "res/test_file.res")`

Used annotations:
* `test` on modules, classes and properties to indicate that nitunit must run this module/class/method
* `before`, `after` on properties from all classes but `Sys` for the before/after each case hooks
* `before_all`, `after_all` on properties from `Sys` for the before/after all cases hooks

This also removes the need of the `lib/test_suite` module.

I also migrated the existing test suites to the new annotations system. Let's see what Jenkins has to say about it.

Should fix #2165

Pull-Request: #2474
Reviewed-by: Jean Privat <jean@pryen.org>

71 files changed:
contrib/nitrpg/src/test_achievements.nit
contrib/nitrpg/src/test_events.nit
contrib/nitrpg/src/test_game.nit
contrib/nitrpg/src/test_helper.nit
contrib/nitrpg/src/test_listener.nit
contrib/nitrpg/src/test_statistics.nit
lib/bitmap/test_bitmap.nit
lib/core/core.nit
lib/core/text/test_abstract_text.nit
lib/github/test_github_curl.nit
lib/gmp/test_native_gmp.nit
lib/markdown/test_markdown.nit
lib/markdown/test_wikilinks.nit
lib/popcorn/examples/angular/tests/test_example_angular.nit
lib/popcorn/examples/handlers/tests/test_example_post_handler.nit
lib/popcorn/examples/handlers/tests/test_example_query_string.nit
lib/popcorn/examples/hello_world/tests/test_example_hello.nit
lib/popcorn/examples/middlewares/tests/test_example_advanced_logger.nit
lib/popcorn/examples/middlewares/tests/test_example_html_error_handler.nit
lib/popcorn/examples/middlewares/tests/test_example_simple_error_handler.nit
lib/popcorn/examples/middlewares/tests/test_example_simple_logger.nit
lib/popcorn/examples/routing/tests/test_example_glob_route.nit
lib/popcorn/examples/routing/tests/test_example_param_route.nit
lib/popcorn/examples/routing/tests/test_example_router.nit
lib/popcorn/examples/sessions/tests/test_example_session.nit
lib/popcorn/examples/static_files/tests/test_example_static.nit
lib/popcorn/examples/static_files/tests/test_example_static_default.nit
lib/popcorn/examples/static_files/tests/test_example_static_multiple.nit
lib/popcorn/examples/templates/tests/test_example_templates.nit
lib/popcorn/pop_tests.nit
lib/popcorn/tests/test_pop_routes.nit
lib/popcorn/tests/test_popcorn.nit
lib/sax/helpers/test_attributes_impl.nit
lib/sax/helpers/test_namespace_support.nit
lib/saxophonit/test_saxophonit.nit
lib/saxophonit/test_testing.nit
lib/saxophonit/testing.nit
lib/template/test_macro.nit
lib/test_suite.ini [deleted file]
lib/test_suite.nit [deleted file]
share/man/nitunit.md
src/catalog.nit
src/compiler/test_coloring.nit
src/frontend/no_warning.nit
src/frontend/parse_annotations.nit
src/loader.nit
src/model/mmodule.nit
src/model/model.nit
src/model/model_base.nit
src/model/model_views.nit
src/model/model_visitor.nit
src/model/test_model_json.nit
src/testing/README.md
src/testing/testing_gen.nit
src/testing/testing_suite.nit
src/web/web_base.nit
tests/sav/nitunit_args1.res
tests/sav/nitunit_args11.res
tests/sav/nitunit_args12.res
tests/sav/nitunit_args2.res
tests/sav/nitunit_args3.res
tests/sav/nitunit_args9.res
tests/sav/syntax_annotations3.res
tests/test_nitunit4/test_bad_comp.nit
tests/test_nitunit4/test_bad_comp2.nit
tests/test_nitunit4/test_nitunit4.nit
tests/test_nitunit4/test_nitunit4_base.nit
tests/test_nitunit5.nit
tests/test_nitunit6.nit
tests/test_nitunit7.nit
tests/test_test_nitunit.nit

index c210c60..41d9dd1 100644 (file)
 # limitations under the License.
 
 # Test module for `achievements.nit`
-module test_achievements is test_suite
+module test_achievements is test
 
 import test_helper
 import achievements
 
 class TestGame
        super NitrpgTestHelper
+       test
 
-       fun test_add_achievement do
+       fun test_add_achievement is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var a1 = new Achievement(game, "test_id1", "test_name", "test_desc", 15)
@@ -33,7 +34,7 @@ class TestGame
                assert game.load_achievements.length == 2
        end
 
-       fun test_load_achievement do
+       fun test_load_achievement is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var a1 = new Achievement(game, "test_id1", "test_name", "test_desc", 15)
@@ -43,7 +44,7 @@ class TestGame
                assert game.load_achievement(a2.id) == null
        end
 
-       fun test_load_achievements do
+       fun test_load_achievements is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var a1 = new Achievement(game, "test_id1", "test_name", "test_desc", 15)
@@ -61,8 +62,9 @@ end
 
 class TestPlayer
        super NitrpgTestHelper
+       test
 
-       fun test_add_achievement do
+       fun test_add_achievement is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var player1 = new Player(game, "Morriar")
@@ -73,7 +75,7 @@ class TestPlayer
                assert player1.load_achievements.length == 2
        end
 
-       fun test_load_achievement do
+       fun test_load_achievement is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var player1 = new Player(game, "Morriar")
@@ -88,7 +90,7 @@ class TestPlayer
                assert player2.load_achievement(a1.id) == null
        end
 
-       fun test_load_achievements do
+       fun test_load_achievements is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var player1 = new Player(game, "Morriar")
@@ -108,8 +110,9 @@ end
 
 class TestAchievement
        super NitrpgTestHelper
+       test
 
-       fun test_init do
+       fun test_init is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var a = new Achievement(game, "test_id", "test_name", "test_desc", 15)
@@ -119,7 +122,7 @@ class TestAchievement
                assert a.reward == 15
        end
 
-       fun test_init_from_json do
+       fun test_init_from_json is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var json = """{
index 640e8dc..efe24cf 100644 (file)
 # limitations under the License.
 
 # Test module for `events.nit`
-module test_events is test_suite
+module test_events is test
 
 import test_helper
 import events
 
 class TestGame
        super NitrpgTestHelper
+       test
 
-       fun test_add_event do
+       fun test_add_event is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var event1 = new GameEvent(game, "test_kind", new JsonObject)
@@ -33,7 +34,7 @@ class TestGame
                assert game.load_events.length == 2
        end
 
-       fun test_load_event do
+       fun test_load_event is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var event1 = new GameEvent(game, "test_kind", new JsonObject)
@@ -43,7 +44,7 @@ class TestGame
                assert game.load_event(event2.internal_id) == null
        end
 
-       fun test_load_events do
+       fun test_load_events is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var event1 = new GameEvent(game, "test_kind", new JsonObject)
@@ -61,8 +62,9 @@ end
 
 class TestPlayer
        super NitrpgTestHelper
+       test
 
-       fun test_add_event do
+       fun test_add_event is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var player1 = new Player(game, "Morriar")
@@ -75,7 +77,7 @@ class TestPlayer
                assert player2.load_events.length == 0
        end
 
-       fun test_load_event do
+       fun test_load_event is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var player1 = new Player(game, "Morriar")
@@ -90,7 +92,7 @@ class TestPlayer
                assert player2.load_event(event1.internal_id) == null
        end
 
-       fun test_load_events do
+       fun test_load_events is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var player1 = new Player(game, "Morriar")
@@ -110,15 +112,16 @@ end
 
 class TestGameEvent
        super NitrpgTestHelper
+       test
 
-       fun test_init do
+       fun test_init is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var event = new GameEvent(game, "test_kind", new JsonObject)
                assert event.to_json_object["kind"] == "test_kind"
        end
 
-       fun test_init_from_json do
+       fun test_init_from_json is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var json = """{
index 25ddcad..c2aa677 100644 (file)
 # limitations under the License.
 
 # Test module for `game.nit`.
-module test_game is test_suite
+module test_game is test
 
 import test_helper
 
 class TestGame
        super NitrpgTestHelper
+       test
 
-       fun test_add_player do
+       fun test_add_player is test do
                var db = gen_test_db
                var game = load_game("privat/nit", db)
                var users = ["Morriar", "xymus"]
@@ -36,7 +37,7 @@ class TestGame
                end
        end
 
-       fun test_load_player do
+       fun test_load_player is test do
                var db = gen_test_db
                var game = load_game("privat/nit", db)
                var ogame = load_game("Morriar/nit", db)
@@ -52,7 +53,7 @@ class TestGame
                assert ogame.load_player("Morriar") == null
        end
 
-       fun test_load_players do
+       fun test_load_players is test do
                var db = gen_test_db
                var game = load_game("privat/nit", db)
                var ogame = load_game("Morriar/nit", db)
@@ -72,8 +73,9 @@ end
 
 class TestPlayer
        super NitrpgTestHelper
+       test
 
-       fun test_init do
+       fun test_init is test do
                var db = gen_test_db
                var game = load_game("privat/nit", db)
                var player = new Player(game, "Morriar")
@@ -82,7 +84,7 @@ class TestPlayer
                assert player.nitcoins == 0
        end
 
-       fun test_init_from_json do
+       fun test_init_from_json is test do
                var db = gen_test_db
                var game = load_game("privat/nit", db)
                var json = """{"name": "Morriar", "nitcoins": 10}""".parse_json
@@ -92,7 +94,7 @@ class TestPlayer
                assert player.nitcoins == 10
        end
 
-       fun test_save do
+       fun test_save is test do
                var db = gen_test_db
                var game = load_game("privat/nit", db)
                var json = """{"name": "Morriar", "nitcoins": 10}""".parse_json.as(JsonObject)
@@ -101,7 +103,7 @@ class TestPlayer
                assert game.db.collection("players").find(json) != null
        end
 
-       fun test_game_add_player do
+       fun test_game_add_player is test do
                var db = gen_test_db
                var game = load_game("privat/nit", db)
                game.add_player(game.api.load_user("Morriar").as(not null))
@@ -109,7 +111,7 @@ class TestPlayer
                assert game.db.collection("players").find(json) != null
        end
 
-       fun test_game_load_player do
+       fun test_game_load_player is test do
                var db = gen_test_db
                var game = load_game("privat/nit", db)
                var json = """{"name": "Morriar", "nitcoins": 10}""".parse_json.as(JsonObject)
@@ -123,8 +125,9 @@ end
 
 class TestUser
        super NitrpgTestHelper
+       test
 
-       fun test_player do
+       fun test_player is test do
                var db = gen_test_db
                var api = new GithubAPI(get_github_oauth)
                var game = load_game("privat/nit", db)
index ecdc358..919ccfc 100644 (file)
 # Test tools for NitRPG.
 module test_helper
 
-import test_suite
 import game
 import github::cache
 
 # Used to factorize test treatments.
 abstract class NitrpgTestHelper
-       super TestSuite
 
        # Github API client
        var api: GithubAPI do
@@ -70,5 +68,6 @@ abstract class NitrpgTestHelper
                db.drop
        end
 
-       redef fun after_test do drop_test_db
+       # Drop the databse after each test
+       fun after_test is after do drop_test_db
 end
index 9cfa059..d70f3aa 100644 (file)
@@ -15,7 +15,7 @@
 # limitations under the License.
 
 # Test module for `listener.nit`
-module test_listener is test_suite
+module test_listener is test
 
 import test_helper
 import reactors
@@ -24,6 +24,7 @@ import events_generator
 
 private class DummyListener
        super NitrpgTestHelper
+       test
 
        var reactors = new Array[GameReactor]
 
@@ -39,12 +40,13 @@ end
 
 class TestListener
        super NitrpgTestHelper
+       test
 
        var generator = new EventsGenerator(api)
 
        var repo: Repo is lazy do return load_repo("Morriar/nit")
 
-       fun test_game_issue_stats do
+       fun test_game_issue_stats is test do
                var db = gen_test_db
                var l = new DummyListener
                l.add_reactor(new StatisticsReactor)
@@ -66,7 +68,7 @@ class TestListener
                assert game.stats.overall["issues_open"] == 1
        end
 
-       fun test_player_issue_stats do
+       fun test_player_issue_stats is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var l = new DummyListener
@@ -89,7 +91,7 @@ class TestListener
                assert player.stats.overall["issues_open"] == 1
        end
 
-       fun test_game_pr_stats do
+       fun test_game_pr_stats is test do
                var db = gen_test_db
                var l = new DummyListener
                l.add_reactor(new StatisticsReactor)
@@ -121,7 +123,7 @@ class TestListener
                assert game.stats.overall["commits"] == 2
        end
 
-       fun test_game_issue_comment_stats do
+       fun test_game_issue_comment_stats is test do
                var db = gen_test_db
                var l = new DummyListener
                l.add_reactor(new StatisticsReactor)
@@ -143,7 +145,7 @@ class TestListener
                assert game.stats.overall["reviews"] == 1
        end
 
-       fun test_player_pull_reactor do
+       fun test_player_pull_reactor is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var l = new DummyListener
@@ -168,7 +170,7 @@ class TestListener
                assert player.stats.overall["nitcoins"] == 12
        end
 
-       fun test_player_review_reactor do
+       fun test_player_review_reactor is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var l = new DummyListener
@@ -211,7 +213,7 @@ class TestListener
                assert player.stats.overall["nitcoins"] == 4
        end
 
-       fun test_X_issues_achievements do
+       fun test_X_issues_achievements is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var l = new DummyListener
@@ -234,7 +236,7 @@ class TestListener
                assert player.stats.overall["nitcoins"] == 1110
        end
 
-       fun test_X_pulls_achievements do
+       fun test_X_pulls_achievements is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var l = new DummyListener
@@ -257,7 +259,7 @@ class TestListener
                assert player.stats.overall["nitcoins"] == 1110
        end
 
-       fun test_X_commits_achievements do
+       fun test_X_commits_achievements is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var l = new DummyListener
@@ -283,7 +285,7 @@ class TestListener
                assert player.stats.overall["nitcoins"] == 11110
        end
 
-       fun test_X_comments_achievements do
+       fun test_X_comments_achievements is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var l = new DummyListener
@@ -308,7 +310,7 @@ class TestListener
                assert player.stats.overall["nitcoins"] == 1110
        end
 
-    fun test_issues_achievements do
+    fun test_issues_achievements is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var l = new DummyListener
@@ -325,7 +327,7 @@ class TestListener
                assert player.stats.overall["nitcoins"] == 20
        end
 
-       fun test_comments_reactor do
+       fun test_comments_reactor is test do
                var db = gen_test_db
                var game = load_game("Morriar/nit", db)
                var l = new DummyListener
index 766726c..9bdf8fa 100644 (file)
 # limitations under the License.
 
 # Test module for `stats.nit`
-module test_statistics is test_suite
+module test_statistics is test
 
 import test_helper
 import statistics
 
 class TestGame
        super NitrpgTestHelper
+       test
 
-       fun test_game_stats do
+       fun test_game_stats is test do
                var db = gen_test_db
                var game = load_game("privat/nit", db)
                var stats = game.stats
@@ -40,8 +41,9 @@ end
 
 class TestPlayer
        super NitrpgTestHelper
+       test
 
-       fun test_player_stats do
+       fun test_player_stats is test do
                var db = gen_test_db
                var game = load_game("privat/nit", db)
                var player = new Player(game, "Morriar")
@@ -59,8 +61,9 @@ end
 
 class TestGameStats
        super NitrpgTestHelper
+       test
 
-       fun test_init_from_json do
+       fun test_init_from_json is test do
                var db = gen_test_db
                var game = load_game("privat/nit", db)
                var owner = new Player(game, "Morriar")
index 4475689..2f76da6 100644 (file)
 #
 #
 # A module for testing the classes in the bitmap module
-module test_bitmap is test_suite
+module test_bitmap is test
 
 import bitmap
-import test_suite
 
 class TestBitmap
-       super TestSuite
+       test
 
-       fun test_grayscale do
+       fun test_grayscale is test do
                var bitmap = new Bitmap.with_size(400, 300)
                for y in [0..300] do
                        for x in [0..200] do bitmap.set_pixel(x, y, 0x0077AAAA)
index 97a4271..6eaff6e 100644 (file)
 
 # Standard classes and methods used by default by Nit programs and libraries.
 # This module is implicitly imported by every module.
-module core
+module core is
+       new_annotation test
+       new_annotation before
+       new_annotation before_all
+       new_annotation after
+       new_annotation after_all
+end
 
 import posix
 import environ
index af7dc00..ec9bda6 100644 (file)
@@ -8,21 +8,20 @@
 # You  are  allowed  to  redistribute it and sell it, alone or is a part of
 # another product.
 
-module test_abstract_text is test_suite
+module test_abstract_text is test
 
-import test_suite
 import text
 intrude import ropes
 
 class TestText
-       super TestSuite
+       test
 
        private var factories: Collection[TextFactory] = [
                new ConcatFactory,
                new FlatBufferFactory
        : TextFactory]
 
-       fun test_escape_to_c do
+       fun test_escape_to_c is test do
                for f in factories do
                        assert f.create("abAB12<>&").escape_to_c       == "abAB12<>&"
                        assert f.create("\n\"'\\").escape_to_c         == "\\n\\\"\\'\\\\"
index e0369ed..25ce970 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_github_curl is test_suite
+module test_github_curl is test
 
 import github::github_curl
-import test_suite
 
 class TestGithubCurl
-       super TestSuite
+       test
 
        var auth: String = get_github_oauth
        var user_agent: String = "nit"
        var testee: GithubCurl is noinit
 
-       redef fun before_test do
+       fun before_test is before do
                testee = new GithubCurl(auth, user_agent)
        end
 
-       fun test_get_repo do
+       fun test_get_repo is test do
                var uri = "https://api.github.com/repos/nitlang/nit"
                var res = testee.get_and_check(uri)
 
@@ -37,7 +36,7 @@ class TestGithubCurl
                assert res["owner"] isa JsonObject
        end
 
-       fun test_get_user do
+       fun test_get_user is test do
                var uri = "https://api.github.com/users/Morriar"
                var res = testee.get_and_check(uri)
 
index b27a3c0..fc00782 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_native_gmp is test_suite
+module test_native_gmp is test
 
-import test_suite
 import native_gmp
 
 class TestNativeMPZ
-    super TestSuite
+       test
 
     var op1: NativeMPZ
     var op2: NativeMPZ
@@ -26,9 +25,7 @@ class TestNativeMPZ
     var r: NativeMPQ
     var res: NativeMPZ
 
-    init do end
-
-    redef fun before_test do
+    fun before_test is before do
         op1 = new NativeMPZ
         op2 = new NativeMPZ
         ui = new UInt64
@@ -36,7 +33,7 @@ class TestNativeMPZ
         res = new NativeMPZ
     end
 
-    redef fun after_test do
+    fun after_test is after do
         op1.finalize
         op2.finalize
         ui.free
@@ -212,23 +209,21 @@ class TestNativeMPZ
 end
 
 class TestNativeMPQ
-    super TestSuite
+       test
 
     var op1: NativeMPQ
     var op2: NativeMPQ
     var l: NativeMPZ
     var res: NativeMPQ
 
-    init do end
-
-    redef fun before_test do
+    fun before_test is before do
         op1 = new NativeMPQ
         op2 = new NativeMPQ
         l = new NativeMPZ
         res = new NativeMPQ
     end
 
-    redef fun after_test do
+    fun after_test is after do
         op1.finalize
         op2.finalize
         l.finalize
index 8a2c7a0..ad58649 100644 (file)
 # limitations under the License.
 
 # Test suites for module `markdown`
-module test_markdown is test_suite
+module test_markdown is test
 
-import test_suite
 intrude import markdown
 
 class TestMarkdownProcessor
-       super TestSuite
+       test
 
-       fun test_process_empty do
+       fun test_process_empty is test do
                var test = ""
                var exp = ""
                var res = test.md_to_html.write_to_string
                assert res == exp
        end
 
-       fun test_process_tabs do
+       fun test_process_tabs is test do
                var test = """
        some code
 """
@@ -40,14 +39,14 @@ class TestMarkdownProcessor
        end
 
 
-       fun test_process_par1 do
+       fun test_process_par1 is test do
                var test = "test"
                var exp = "<p>test</p>\n"
                var res = test.md_to_html.write_to_string
                assert res == exp
        end
 
-       fun test_process_par2 do
+       fun test_process_par2 is test do
                var test = """
 line1
 line2
@@ -65,7 +64,7 @@ line2</p>
                assert res == exp
        end
 
-       fun test_process_par3 do
+       fun test_process_par3 is test do
                var test = """
 Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
 Aliquam hendrerit mi posuere lectus.
@@ -85,7 +84,7 @@ id sem consectetuer libero luctus adipiscing.</p>
                assert res == exp
        end
 
-       fun test_process_headings_1 do
+       fun test_process_headings_1 is test do
                var test = """
 This is a H1
 =============
@@ -101,7 +100,7 @@ This is a H2
                assert res == exp
        end
 
-       fun test_process_headings_2 do
+       fun test_process_headings_2 is test do
                var test = """
 # This is a H1
 
@@ -117,7 +116,7 @@ This is a H2
                assert res == exp
        end
 
-       fun test_process_headings_3 do
+       fun test_process_headings_3 is test do
                var test = """
 # This is a H1 #
 
@@ -134,7 +133,7 @@ This is a H2
                assert res == exp
        end
 
-       fun test_process_hr do
+       fun test_process_hr is test do
                var test = """
 * * *
 
@@ -151,7 +150,7 @@ This is a H2
                assert res == exp
        end
 
-       fun test_process_bquote1 do
+       fun test_process_bquote1 is test do
                var test = """
 > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
 > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
@@ -172,7 +171,7 @@ id sem consectetuer libero luctus adipiscing.</p>
                assert res == exp
        end
 
-       fun test_process_bquote2 do
+       fun test_process_bquote2 is test do
                var test = """
 > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
 consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
@@ -193,7 +192,7 @@ id sem consectetuer libero luctus adipiscing.</p>
                assert res == exp
        end
 
-       fun test_process_bquote3 do
+       fun test_process_bquote3 is test do
                var test = """
 > This is the first level of quoting.
 >
@@ -213,7 +212,7 @@ id sem consectetuer libero luctus adipiscing.</p>
                assert res == exp
        end
 
-       fun test_process_list1 do
+       fun test_process_list1 is test do
                var test = """
 *   Red
 *   Green
@@ -229,7 +228,7 @@ id sem consectetuer libero luctus adipiscing.</p>
                assert res == exp
        end
 
-       fun test_process_list2 do
+       fun test_process_list2 is test do
                var test = """
 +   Red
 +   Green
@@ -245,7 +244,7 @@ id sem consectetuer libero luctus adipiscing.</p>
                assert res == exp
        end
 
-       fun test_process_list3 do
+       fun test_process_list3 is test do
                var test = """
 -   Red
 -   Green
@@ -261,7 +260,7 @@ id sem consectetuer libero luctus adipiscing.</p>
                assert res == exp
        end
 
-       fun test_process_list4 do
+       fun test_process_list4 is test do
                var test = """
 1.  Bird
 2.  McHale
@@ -277,7 +276,7 @@ id sem consectetuer libero luctus adipiscing.</p>
                assert res == exp
        end
 
-       fun test_process_list5 do
+       fun test_process_list5 is test do
                var test = """
 3. Bird
 1. McHale
@@ -293,7 +292,7 @@ id sem consectetuer libero luctus adipiscing.</p>
                assert res == exp
        end
 
-       fun test_process_list6 do
+       fun test_process_list6 is test do
                var test = """
 *   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
     Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
@@ -314,7 +313,7 @@ Suspendisse id sem consectetuer libero luctus adipiscing.</li>
                assert res == exp
        end
 
-       fun test_process_list7 do
+       fun test_process_list7 is test do
                var test = """
 *   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
 Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
@@ -335,7 +334,7 @@ Suspendisse id sem consectetuer libero luctus adipiscing.</li>
                assert res == exp
        end
 
-       fun test_process_list8 do
+       fun test_process_list8 is test do
                var test = """
 *   Bird
 
@@ -353,7 +352,7 @@ Suspendisse id sem consectetuer libero luctus adipiscing.</li>
                assert res == exp
        end
 
-       fun test_process_list9 do
+       fun test_process_list9 is test do
                var test = """
 1.  This is a list item with two paragraphs. Lorem ipsum dolor
     sit amet, consectetuer adipiscing elit. Aliquam hendrerit
@@ -382,7 +381,7 @@ sit amet velit.</p>
                assert res == exp
        end
 
-       fun test_process_list10 do
+       fun test_process_list10 is test do
                var test = """
 *   This is a list item with two paragraphs.
 
@@ -407,7 +406,7 @@ sit amet, consectetuer adipiscing elit.</p>
                assert res == exp
        end
 
-       fun test_process_list11 do
+       fun test_process_list11 is test do
                var test = """
 This is a paragraph
 * and this is not a list
@@ -422,7 +421,7 @@ This is a paragraph
                assert res == exp
        end
 
-       fun test_process_list_ext do
+       fun test_process_list_ext is test do
                var test = """
 This is a paragraph
 * and this is not a list
@@ -437,7 +436,7 @@ This is a paragraph
                assert res == exp
        end
 
-       fun test_process_code1 do
+       fun test_process_code1 is test do
                var test = """
 This is a normal paragraph:
 
@@ -451,7 +450,7 @@ This is a normal paragraph:
                assert res == exp
        end
 
-       fun test_process_code2 do
+       fun test_process_code2 is test do
                var test = """
 Here is an example of AppleScript:
 
@@ -478,7 +477,7 @@ end tell
                assert res == exp
        end
 
-       fun test_process_code_ext1 do
+       fun test_process_code_ext1 is test do
                var test = """
 Here is an example of AppleScript:
 ~~~
@@ -506,7 +505,7 @@ end tell
                assert res == exp
        end
 
-       fun test_process_code_ext2 do
+       fun test_process_code_ext2 is test do
                var test = """
 Here is an example of AppleScript:
 ```
@@ -534,7 +533,7 @@ end tell
                assert res == exp
        end
 
-       fun test_process_code_ext3 do
+       fun test_process_code_ext3 is test do
                var proc = new MarkdownProcessor
                proc.ext_mode = false
 
@@ -550,7 +549,7 @@ beep</p>
                assert res == exp
        end
 
-       fun test_process_code_ext4 do
+       fun test_process_code_ext4 is test do
                var test = """
 Here is an example of AppleScript:
     beep
@@ -564,7 +563,7 @@ Here is an example of AppleScript:
                assert res == exp
        end
 
-       fun test_process_code_ext5 do
+       fun test_process_code_ext5 is test do
                var test = """
 ```nit
 print "Hello World!"
@@ -578,7 +577,7 @@ print "Hello World!"
                assert res == exp
        end
 
-       fun test_process_code_ext6 do
+       fun test_process_code_ext6 is test do
                var test = """
 ~~~
 print "Hello"
@@ -597,7 +596,7 @@ print "World"
                assert res == exp
        end
 
-       fun test_process_code_ext7 do
+       fun test_process_code_ext7 is test do
                var test = """
 ~~~
 print "Hello"
@@ -616,7 +615,7 @@ print "World"
                assert res == exp
        end
 
-       fun test_process_nesting1 do
+       fun test_process_nesting1 is test do
                var test = """
 > ## This is a header.
 >
@@ -643,7 +642,7 @@ print "World"
                assert res == exp
        end
 
-       fun test_process_nesting2 do
+       fun test_process_nesting2 is test do
                var test = """
 *   A list item with a blockquote:
 
@@ -664,7 +663,7 @@ inside a list item.</p>
                assert res == exp
        end
 
-       fun test_process_nesting3 do
+       fun test_process_nesting3 is test do
                var test = """
 *   A list item with a code block:
 
@@ -682,7 +681,7 @@ inside a list item.</p>
                assert res == exp
        end
 
-       fun test_process_nesting4 do
+       fun test_process_nesting4 is test do
                var test = """
 *      Tab
        *       Tab
@@ -704,7 +703,7 @@ inside a list item.</p>
        end
 
        # TODO
-       #       fun test_process_nesting5 do
+       #       fun test_process_nesting5 is test do
        #               var test = """
        # *     this
        #
@@ -726,7 +725,7 @@ inside a list item.</p>
        #               assert res == exp
        #       end
 
-       fun test_process_emph1 do
+       fun test_process_emph1 is test do
                var test = """
 *single asterisks*
 
@@ -745,14 +744,14 @@ __double underscores__
                assert res == exp
        end
 
-       fun test_process_emph2 do
+       fun test_process_emph2 is test do
                var test = "un*frigging*believable"
                var exp = "<p>un<em>frigging</em>believable</p>\n"
                var res = test.md_to_html.write_to_string
                assert res == exp
        end
 
-       fun test_process_emph3 do
+       fun test_process_emph3 is test do
                var proc = new MarkdownProcessor
                proc.ext_mode = false
                var test = "Con_cat_this"
@@ -761,14 +760,14 @@ __double underscores__
                assert res == exp
        end
 
-       fun test_process_emph_ext do
+       fun test_process_emph_ext is test do
                var test = "Con_cat_this"
                var exp = "<p>Con_cat_this</p>\n"
                var res = test.md_to_html.write_to_string
                assert res == exp
        end
 
-       fun test_process_xml1 do
+       fun test_process_xml1 is test do
                var test = """
 This is a regular paragraph.
 
@@ -793,7 +792,7 @@ This is another regular paragraph.
                assert res == exp
        end
 
-       fun test_process_xml2 do
+       fun test_process_xml2 is test do
                var test = """
 This is an image <img src="foo/bar" alt="baz"/> in a regular paragraph.
 """
@@ -803,7 +802,7 @@ This is an image <img src="foo/bar" alt="baz"/> in a regular paragraph.
                assert res == exp
        end
 
-       fun test_process_xml3 do
+       fun test_process_xml3 is test do
                var test = """
 <div style=">"/>
 """
@@ -814,7 +813,7 @@ This is an image <img src="foo/bar" alt="baz"/> in a regular paragraph.
                assert res == exp
        end
 
-       fun test_process_xml4 do
+       fun test_process_xml4 is test do
                var test = """
 <p>This is an example of a block element that should be escaped.</p>
 <p>Idem for the second paragraph.</p>
@@ -824,7 +823,7 @@ This is an image <img src="foo/bar" alt="baz"/> in a regular paragraph.
                assert res == exp
        end
 
-       fun test_process_xml5 do
+       fun test_process_xml5 is test do
                var test = """
 # Some more XML tests
 
@@ -844,21 +843,21 @@ With a *md paragraph*!
                assert res == exp
        end
 
-       fun test_process_span_code1 do
+       fun test_process_span_code1 is test do
                var test = "Use the `printf()` function."
                var exp = "<p>Use the <code>printf()</code> function.</p>\n"
                var res = test.md_to_html.write_to_string
                assert res == exp
        end
 
-       fun test_process_span_code2 do
+       fun test_process_span_code2 is test do
                var test = "``There is a literal backtick (`) here.``"
                var exp = "<p><code>There is a literal backtick (`) here.</code></p>\n"
                var res = test.md_to_html.write_to_string
                assert res == exp
        end
 
-       fun test_process_span_code3 do
+       fun test_process_span_code3 is test do
                var test = """
 A single backtick in a code span: `` ` ``
 
@@ -872,42 +871,42 @@ A backtick-delimited string in a code span: `` `foo` ``
                assert res == exp
        end
 
-       fun test_process_span_code4 do
+       fun test_process_span_code4 is test do
                var test = "Please don't use any `<blink>` tags."
                var exp = "<p>Please don't use any <code>&lt;blink&gt;</code> tags.</p>\n"
                var res = test.md_to_html.write_to_string
                assert res == exp
        end
 
-       fun test_process_span_code5 do
+       fun test_process_span_code5 is test do
                var test = "`&#8212;` is the decimal-encoded equivalent of `&mdash;`."
                var exp = "<p><code>&amp;#8212;</code> is the decimal-encoded equivalent of <code>&amp;mdash;</code>.</p>\n"
                var res = test.md_to_html.write_to_string
                assert res == exp
        end
 
-       fun test_process_escape1 do
+       fun test_process_escape1 is test do
                var test = "\\*this text is surrounded by literal asterisks\\*"
                var exp = "<p>*this text is surrounded by literal asterisks*</p>\n"
                var res = test.md_to_html.write_to_string
                assert res == exp
        end
 
-       fun test_process_escape2 do
+       fun test_process_escape2 is test do
                var test = "1986\\. What a great season."
                var exp = "<p>1986. What a great season.</p>\n"
                var res = test.md_to_html.write_to_string
                assert res == exp
        end
 
-       fun test_process_escape3 do
+       fun test_process_escape3 is test do
                var test = "Ben & Lux"
                var exp = "<p>Ben &amp; Lux</p>\n"
                var res = test.md_to_html.write_to_string
                assert res == exp
        end
 
-       fun test_process_link1 do
+       fun test_process_link1 is test do
                var test = """
 This is [an example](http://example.com/ "Title") inline link.
 
@@ -920,14 +919,14 @@ This is [an example](http://example.com/ "Title") inline link.
                assert res == exp
        end
 
-       fun test_process_link2 do
+       fun test_process_link2 is test do
                var test = "See my [About](/about/) page for details."
                var exp = "<p>See my <a href=\"/about/\">About</a> page for details.</p>\n"
                var res = test.md_to_html.write_to_string
                assert res == exp
        end
 
-       fun test_process_link3 do
+       fun test_process_link3 is test do
                var test = """
 This is [an example][id] reference-style link.
 
@@ -949,7 +948,7 @@ Some other lipsum
                assert res == exp
        end
 
-       fun test_process_link4 do
+       fun test_process_link4 is test do
                var test = """
 This is multiple examples: [foo][1], [bar][2], [baz][3].
 
@@ -964,7 +963,7 @@ This is multiple examples: [foo][1], [bar][2], [baz][3].
                assert res == exp
        end
 
-       fun test_process_link5 do
+       fun test_process_link5 is test do
                var test = """
 This is multiple examples: [foo][a], [bar][A], [a].
 
@@ -976,7 +975,7 @@ This is multiple examples: [foo][a], [bar][A], [a].
                assert res == exp
        end
 
-       fun test_process_link6 do
+       fun test_process_link6 is test do
                var test = """
 I get 10 times more traffic from [Google][] than from [Yahoo][] or [MSN][].
 
@@ -990,7 +989,7 @@ I get 10 times more traffic from [Google][] than from [Yahoo][] or [MSN][].
                assert res == exp
        end
 
-       fun test_process_link7 do
+       fun test_process_link7 is test do
                var test = """
 Visit [Daring Fireball][] for more information.
 
@@ -1002,7 +1001,7 @@ Visit [Daring Fireball][] for more information.
                assert res == exp
        end
 
-       fun test_process_link8 do
+       fun test_process_link8 is test do
                var test = """
 This one has a [line
 break].
@@ -1023,7 +1022,7 @@ break</a> with a line-ending space.</p>
        end
 
        # FIXME unignore test once escape strings fixed
-       #       fun test_process_link9 do
+       #       fun test_process_link9 is test do
        #               var test = """
        # Foo [bar][].
        #
@@ -1040,7 +1039,7 @@ break</a> with a line-ending space.</p>
        #               assert res == exp
        #       end
 
-       fun test_process_img1 do
+       fun test_process_img1 is test do
                var test = """
 ![Alt text](/path/to/img.jpg)
 
@@ -1053,7 +1052,7 @@ break</a> with a line-ending space.</p>
                assert res == exp
        end
 
-       fun test_process_img2 do
+       fun test_process_img2 is test do
                var test = """
 ![Alt text][id]
 
@@ -1065,7 +1064,7 @@ break</a> with a line-ending space.</p>
                assert res == exp
        end
 
-       fun test_process_strike do
+       fun test_process_strike is test do
                var proc = new MarkdownProcessor
                proc.ext_mode = false
                var test = "This is how you ~~strike text~~"
@@ -1074,21 +1073,21 @@ break</a> with a line-ending space.</p>
                assert exp == res
        end
 
-       fun test_process_strike_ext do
+       fun test_process_strike_ext is test do
                var test = "This is how you ~~strike text~~"
                var exp = "<p>This is how you <del>strike text</del></p>\n"
                var res = test.md_to_html.write_to_string
                assert exp == res
        end
 
-       fun test_escape_bad_html do
+       fun test_escape_bad_html is test do
                        var test = "-1 if < , +1 if > and 0 otherwise"
                        var exp = "<p>-1 if &lt; , +1 if > and 0 otherwise</p>\n"
                var res = test.md_to_html.write_to_string
                assert exp == res
        end
 
-       fun test_daring_encoding do
+       fun test_daring_encoding is test do
                var test = """
 AT&T has an ampersand in their name.
 
@@ -1129,7 +1128,7 @@ Here's an inline [link](</script?foo=1&bar=2>).
 
        end
 
-       fun test_daring_autolinks do
+       fun test_daring_autolinks is test do
                var test = """
 Link: <http://example.com/>.
 
@@ -1165,7 +1164,7 @@ Auto-links should not occur here: `<http://example.com/>`
                assert res == exp
        end
 
-       fun test_daring_escape do
+       fun test_daring_escape is test do
                var test = """
 These should all get escaped:
 
@@ -1367,7 +1366,7 @@ other Markdown constructs:</p>
                assert res == exp
        end
 
-       fun test_daring_blockquotes do
+       fun test_daring_blockquotes is test do
                var test = """
 > Example:
 >
@@ -1400,7 +1399,7 @@ other Markdown constructs:</p>
                assert res == exp
        end
 
-       fun test_daring_code_blocks do
+       fun test_daring_code_blocks is test do
                var test = """
        code block on the first line
 
@@ -1436,7 +1435,7 @@ all contain trailing spaces
                assert res == exp
        end
 
-       fun test_daring_code_spans do
+       fun test_daring_code_spans is test do
                var test = """
 `<test a="` content of attribute `">`
 
@@ -1454,7 +1453,7 @@ Here's how you put `` `backticks` `` in a code span.
                assert res == exp
        end
 
-       fun test_daring_pars do
+       fun test_daring_pars is test do
                var proc = new MarkdownProcessor
                proc.ext_mode = false
 
@@ -1482,7 +1481,7 @@ list item.</p>
                assert res == exp
        end
 
-       fun test_daring_rules do
+       fun test_daring_rules is test do
                var test = """
 Dashes:
 
@@ -1598,7 +1597,7 @@ _ _ _
                assert res == exp
        end
 
-       fun test_daring_images do
+       fun test_daring_images is test do
                var test = """
 ![Alt text](/path/to/img.jpg)
 
@@ -1645,7 +1644,7 @@ Inline within a paragraph: [alt text](/url/).
                assert res == exp
        end
 
-       fun test_daring_inline_html1 do
+       fun test_daring_inline_html1 is test do
                var test = """
 Here's a simple block:
 
@@ -1768,7 +1767,7 @@ Blah
                assert res == exp
        end
 
-       fun test_daring_inline_html2 do
+       fun test_daring_inline_html2 is test do
                var test = """
 Simple block on one line:
 
@@ -1831,7 +1830,7 @@ foo
                assert res == exp
        end
 
-       fun test_daring_inline_html3 do
+       fun test_daring_inline_html3 is test do
                var test = """
 Paragraph one.
 
@@ -1862,7 +1861,7 @@ The end.
                assert res == exp
        end
 
-       fun test_daring_links1 do
+       fun test_daring_links1 is test do
                var test = """
 Just a [URL](/url/).
 
@@ -1908,7 +1907,7 @@ Just a [URL](/url/).
                assert res == exp
        end
 
-       fun test_daring_links2 do
+       fun test_daring_links2 is test do
                var test = """
 Foo [bar] [1].
 
@@ -2017,7 +2016,7 @@ breaks</a> across lines, but with a line-ending space.</p>
                assert res == exp
        end
 
-       fun test_daring_links3 do
+       fun test_daring_links3 is test do
                var test = """
 This is the [simple case].
 
@@ -2053,7 +2052,7 @@ break</a> with a line-ending space.</p>
                assert res == exp
        end
 
-       fun test_daring_nested do
+       fun test_daring_nested is test do
                var test = """
 > foo
 >
@@ -2075,7 +2074,7 @@ break</a> with a line-ending space.</p>
                assert res == exp
        end
 
-       fun test_daring_list do
+       fun test_daring_list is test do
                var test = """
 ## Unordered
 
@@ -2332,7 +2331,7 @@ back.</p>
                assert res == exp
        end
 
-       fun test_daring_strong_em do
+       fun test_daring_strong_em is test do
                var test = """
 ***This is strong and em.***
 
@@ -2353,7 +2352,7 @@ So is ___this___ word.
                assert res == exp
        end
 
-       fun test_daring_tabs do
+       fun test_daring_tabs is test do
                var test = """
 +      this is a list item
        indented with tabs
@@ -2405,7 +2404,7 @@ indented with spaces</p>
                assert res == exp
        end
 
-       fun test_daring_tidyness do
+       fun test_daring_tidyness is test do
                var test = """
 > A list within a blockquote:
 >
@@ -2432,19 +2431,19 @@ indented with spaces</p>
 end
 
 class TestBlock
-       super TestSuite
+       test
 
        # A dummy location for testing purposes.
        var loc = new MDLocation(0, 0, 0, 0)
 
-       fun test_has_blocks do
+       fun test_has_blocks is test do
                var subject = new MDBlock(loc)
                assert not subject.has_blocks
                subject.first_block = new MDBlock(loc)
                assert subject.has_blocks
        end
 
-       fun test_count_blocks do
+       fun test_count_blocks is test do
                var subject = new MDBlock(loc)
                assert subject.count_blocks == 0
                subject.first_block = new MDBlock(loc)
@@ -2453,14 +2452,14 @@ class TestBlock
                assert subject.count_blocks == 2
        end
 
-       fun test_has_lines do
+       fun test_has_lines is test do
                var subject = new MDBlock(loc)
                assert not subject.has_lines
                subject.first_line = new MDLine(loc, "")
                assert subject.has_lines
        end
 
-       fun test_count_lines do
+       fun test_count_lines is test do
                var subject = new MDBlock(loc)
                assert subject.count_lines == 0
                subject.first_line = new MDLine(loc, "")
@@ -2469,7 +2468,7 @@ class TestBlock
                assert subject.count_lines == 2
        end
 
-       fun test_split do
+       fun test_split is test do
                var line1 = new MDLine(loc, "line1")
                var line2 = new MDLine(loc, "line2")
                var line3 = new MDLine(loc, "line3")
@@ -2487,7 +2486,7 @@ class TestBlock
                assert block.last_line == line2
        end
 
-       fun test_add_line do
+       fun test_add_line is test do
                var subject = new MDBlock(loc)
                assert subject.count_lines == 0
                subject.add_line new MDLine(loc, "")
@@ -2496,7 +2495,7 @@ class TestBlock
                assert subject.count_lines == 2
        end
 
-       fun test_remove_line do
+       fun test_remove_line is test do
                var line1 = new MDLine(loc, "line1")
                var line2 = new MDLine(loc, "line2")
                var line3 = new MDLine(loc, "line3")
@@ -2512,7 +2511,7 @@ class TestBlock
                assert subject.last_line == line3
        end
 
-       fun test_transform_headline1 do
+       fun test_transform_headline1 is test do
                var subject = new MDBlock(loc)
                var kind = new BlockHeadline(subject)
                subject.add_line new MDLine(loc, " #   Title 1   ")
@@ -2521,7 +2520,7 @@ class TestBlock
                assert subject.first_line.value == "Title 1"
        end
 
-       fun test_transform_headline2 do
+       fun test_transform_headline2 is test do
                var subject = new MDBlock(loc)
                var kind = new BlockHeadline(subject)
                subject.add_line new MDLine(loc, " #####Title 5   ")
@@ -2530,7 +2529,7 @@ class TestBlock
                assert subject.first_line.value == "Title 5"
        end
 
-       fun test_remove_quote_prefix do
+       fun test_remove_quote_prefix is test do
                var subject = new MDBlock(loc)
                var kind = new BlockQuote(subject)
                subject.add_line new MDLine(loc, " > line 1")
@@ -2542,7 +2541,7 @@ class TestBlock
                assert subject.first_line.next.next.value == "line 3"
        end
 
-       fun test_remove_leading_empty_lines_1 do
+       fun test_remove_leading_empty_lines_1 is test do
                var block = new MDBlock(loc)
                block.add_line new MDLine(loc, "")
                block.add_line new MDLine(loc, "")
@@ -2554,14 +2553,14 @@ class TestBlock
                assert block.first_line.value == "   text"
        end
 
-       fun test_remove_leading_empty_lines_2 do
+       fun test_remove_leading_empty_lines_2 is test do
                var block = new MDBlock(loc)
                block.add_line new MDLine(loc, "   text")
                block.remove_leading_empty_lines
                assert block.first_line.value == "   text"
        end
 
-       fun test_remove_trailing_empty_lines_1 do
+       fun test_remove_trailing_empty_lines_1 is test do
                var block = new MDBlock(loc)
                block.add_line new MDLine(loc, "")
                block.add_line new MDLine(loc, "text")
@@ -2573,14 +2572,14 @@ class TestBlock
                assert block.last_line.value == "text"
        end
 
-       fun test_remove_trailing_empty_lines_2 do
+       fun test_remove_trailing_empty_lines_2 is test do
                var block = new MDBlock(loc)
                block.add_line new MDLine(loc, "text  ")
                assert not block.remove_trailing_empty_lines
                assert block.last_line.value == "text  "
        end
 
-       fun test_remove_surrounding_empty_lines do
+       fun test_remove_surrounding_empty_lines is test do
                var block = new MDBlock(loc)
                block.add_line new MDLine(loc, "")
                block.add_line new MDLine(loc, "text")
@@ -2595,14 +2594,14 @@ class TestBlock
 end
 
 class TestLine
-       super TestSuite
+       test
 
        # A dummy location for testing purposes.
        var loc = new MDLocation(0, 0, 0, 0)
 
        var subject: MDLine
 
-       fun test_is_empty do
+       fun test_is_empty is test do
                subject = new MDLine(loc, "")
                assert subject.is_empty
                subject = new MDLine(loc, "    ")
@@ -2613,7 +2612,7 @@ class TestLine
                assert not subject.is_empty
        end
 
-       fun test_leading do
+       fun test_leading is test do
                subject = new MDLine(loc, "")
                assert subject.leading == 0
                subject = new MDLine(loc, "    ")
@@ -2624,7 +2623,7 @@ class TestLine
                assert subject.leading == 4
        end
 
-       fun test_trailing do
+       fun test_trailing is test do
                subject = new MDLine(loc, "")
                assert subject.trailing == 0
                subject = new MDLine(loc, "    ")
@@ -2635,7 +2634,7 @@ class TestLine
                assert subject.trailing == 1
        end
 
-       fun test_line_type do
+       fun test_line_type is test do
                var v = new MarkdownProcessor
                subject = new MDLine(loc, "")
                assert v.line_kind(subject) isa LineEmpty
@@ -2681,7 +2680,7 @@ class TestLine
                assert v.line_kind(subject) isa LineOList
        end
 
-       fun test_line_type_ext do
+       fun test_line_type_ext is test do
                var v = new MarkdownProcessor
                subject = new MDLine(loc, "  ~~~")
                assert v.line_kind(subject) isa LineFence
@@ -2691,7 +2690,7 @@ class TestLine
                assert v.line_kind(subject) isa LineFence
        end
 
-       fun test_count_chars do
+       fun test_count_chars is test do
                subject = new MDLine(loc, "")
                assert subject.count_chars('*') == 0
                subject = new MDLine(loc, "* ")
@@ -2704,7 +2703,7 @@ class TestLine
                assert subject.count_chars('*') == 0
        end
 
-       fun test_count_chars_start do
+       fun test_count_chars_start is test do
                subject = new MDLine(loc, "")
                assert subject.count_chars_start('*') == 0
                subject = new MDLine(loc, "* ")
@@ -2719,9 +2718,9 @@ class TestLine
 end
 
 class TestHTMLDecorator
-       super TestSuite
+       test
 
-       fun test_headlines do
+       fun test_headlines is test do
                var test = """
 # **a**
 ## a.a
@@ -2760,9 +2759,9 @@ c:c
 end
 
 class TestTokenLocation
-       super TestSuite
+       test
 
-       fun test_token_location1 do
+       fun test_token_location1 is test do
                var string = "**Hello** `World`"
                var stack =  [
                        "TokenStrongStar at 1,1--1,1",
@@ -2772,7 +2771,7 @@ class TestTokenLocation
                (new TestTokenProcessor(stack)).process(string)
        end
 
-       fun test_token_location2 do
+       fun test_token_location2 is test do
                var string = "**Hello**\n`World`\n*Bonjour*\n[le monde]()"
                var stack =  [
                        "TokenStrongStar at 1,1--1,1",
@@ -2785,7 +2784,7 @@ class TestTokenLocation
                (new TestTokenProcessor(stack)).process(string)
        end
 
-       fun test_token_location3 do
+       fun test_token_location3 is test do
                var string = """**Hello**
                `World`
                *Bonjour*
@@ -2801,7 +2800,7 @@ class TestTokenLocation
                (new TestTokenProcessor(stack)).process(string)
        end
 
-       fun test_token_location4 do
+       fun test_token_location4 is test do
                var string = "**Hello**\n\n`World`"
                var stack =  [
                        "TokenStrongStar at 1,1--1,1",
@@ -2811,7 +2810,7 @@ class TestTokenLocation
                (new TestTokenProcessor(stack)).process(string)
        end
 
-       fun test_token_location5 do
+       fun test_token_location5 is test do
                var string = "# *Title1*\n\n# *Title2*"
                var stack =  [
                        "TokenEmStar at 1,3--1,3",
@@ -2841,11 +2840,11 @@ class TestTokenProcessor
 end
 
 class TestBlockLocation
-       super TestSuite
+       test
 
        var proc = new MarkdownProcessor
 
-       fun test_block_location1 do
+       fun test_block_location1 is test do
                var stack = [
                        "BlockHeadline: 1,1--1,8",
                        "BlockListItem: 2,1--2,6",
@@ -2857,7 +2856,7 @@ class TestBlockLocation
                proc.process(string)
        end
 
-       fun test_block_location2 do
+       fun test_block_location2 is test do
                var stack = [
                        "BlockHeadline: 1,1--1,11",
                        "BlockFence: 3,1--5,4",
@@ -2875,7 +2874,7 @@ some code
                proc.process(string)
        end
 
-       fun test_block_location3 do
+       fun test_block_location3 is test do
                var stack = [
                        "BlockHeadline: 1,1--1,8",
                        "BlockHeadline: 3,1--3,10"]
index 5c4fb7e..133493d 100644 (file)
 # limitations under the License.
 
 # Test suites for module `markdown`
-module test_wikilinks is test_suite
+module test_wikilinks is test
 
 import test_markdown
 import wikilinks
 
 class TestTokenWikilink
-       super TestSuite
+       test
 
-       fun test_token_location1 do
+       fun test_token_location1 is test do
                var string = "[[wikilink]]"
                var stack =  ["TokenWikiLink at 1,1--1,1"]
                (new TestTokenProcessor(stack)).process(string)
        end
 
-       fun test_token_location2 do
+       fun test_token_location2 is test do
                var string = "Hello [[World]]"
                var stack =  ["TokenWikiLink at 1,7--1,7"]
                (new TestTokenProcessor(stack)).process(string)
        end
 
-       fun test_token_location3 do
+       fun test_token_location3 is test do
                var string = "\nHello\nworld [[wikilink]] !"
                var stack =  ["TokenWikiLink at 3,7--3,7"]
                (new TestTokenProcessor(stack)).process(string)
        end
 
-       fun test_token_location4 do
+       fun test_token_location4 is test do
                var string = "[[link1]]\n\n[[link2]]"
                var stack =  [
                        "TokenWikiLink at 1,1--1,1",
@@ -47,7 +47,7 @@ class TestTokenWikilink
                (new TestTokenProcessor(stack)).process(string)
        end
 
-       fun test_token_location5 do
+       fun test_token_location5 is test do
                var string = "[[link1]]\n[[link2]]"
                var stack =  [
                        "TokenWikiLink at 1,1--1,1",
@@ -55,7 +55,7 @@ class TestTokenWikilink
                (new TestTokenProcessor(stack)).process(string)
        end
 
-       fun test_token_location6 do
+       fun test_token_location6 is test do
                var string = """
 [[doc: github]]
 
index 7c6fa1d..7ca4802 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_angular is test_suite
+module test_example_angular is test
 
 import pop_tests
 import example_angular
 
 class TestExampleAngular
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/counter"
@@ -29,7 +30,7 @@ class TestExampleAngular
                system "curl -s {host}:{port}/not_found" # handled by angular controller
        end
 
-       fun test_example_angular do
+       fun test_example_angular is test do
                var app = new App
                app.use("/counter", new CounterAPI)
                app.use("/*", new StaticHandler(test_path / "../www/", "index.html"))
index a1cbb13..a0dc10f 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_post_handler is test_suite
+module test_example_post_handler is test
 
 import pop_tests
 import example_post_handler
 
 class TestExamplePostHandler
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/ -X POST"
@@ -31,7 +32,7 @@ class TestExamplePostHandler
                system "curl -s {host}:{port}/"
        end
 
-       fun test_example_post_handler do
+       fun test_example_post_handler is test do
                var app = new App
                app.use("/", new PostHandler)
                run_test(app)
index db326ea..8909f91 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_query_string is test_suite
+module test_example_query_string is test
 
 import pop_tests
 import example_query_string
 
 class TestExampleQueryString
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
@@ -30,7 +31,7 @@ class TestExampleQueryString
                system "curl -s {host}:{port}/?items=10\\&order=asc"
        end
 
-       fun test_example_query_string do
+       fun test_example_query_string is test do
                var app = new App
                app.use("/", new QueryStringHandler)
                run_test(app)
index 163e624..e206456 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_hello is test_suite
+module test_example_hello is test
 
 import pop_tests
 import example_hello
 
 class TestExampleHello
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}"
@@ -30,7 +31,7 @@ class TestExampleHello
                system "curl -s {host}:{port}/not_found/not_found"
        end
 
-       fun test_example_hello do
+       fun test_example_hello is test do
                var app = new App
                app.use("/", new HelloHandler)
                run_test(app)
index f870136..adfe426 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_advanced_logger is test_suite
+module test_example_advanced_logger is test
 
 import pop_tests
 import example_advanced_logger
 
 class TestExampleAdvancedLogger
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
                system "curl -s {host}:{port}/about"
        end
 
-       fun test_example_advanced_logger do
+       fun test_example_advanced_logger is test do
                var app = new App
                app.use_before("/*", new RequestTimeHandler)
                app.use("/", new AnotherHandler)
index 93912ca..5322bbc 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_html_error_handler is test_suite
+module test_example_html_error_handler is test
 
 import pop_tests
 import example_html_error_handler
 
 class TestExampleHtmlErrorHandler
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
                system "curl -s {host}:{port}/about"
        end
 
-       fun test_example_html_error_handler do
+       fun test_example_html_error_handler is test do
                var app = new App
                app.use("/*", new HtmlErrorHandler)
                run_test(app)
index e45acad..7016f1a 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_simple_error_handler is test_suite
+module test_example_simple_error_handler is test
 
 import pop_tests
 import example_simple_error_handler
 
 class TestExampleSimpleErrorHandler
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
                system "curl -s {host}:{port}/about"
        end
 
-       fun test_example_simple_error_handler do
+       fun test_example_simple_error_handler is test do
                var app = new App
                app.use("/", new SomeHandler)
                app.use("/*", new SimpleErrorHandler)
index b0c41f8..25db274 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_simple_logger is test_suite
+module test_example_simple_logger is test
 
 import pop_tests
 import example_simple_logger
 
 class TestExampleSimpleLogger
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
                system "curl -s {host}:{port}/about"
        end
 
-       fun test_example_simple_logger do
+       fun test_example_simple_logger is test do
                var app = new App
                app.use_before("/*", new SimpleLoggerHandler)
                app.use("/", new MyOtherHandler)
index c258260..e44be2a 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_glob_route is test_suite
+module test_example_glob_route is test
 
 import pop_tests
 import example_glob_route
 
 class TestExampleGlobRoute
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/user/Morriar/item/10"
@@ -32,7 +33,7 @@ class TestExampleGlobRoute
                system "curl -s {host}:{port}/not_found/not_found"
        end
 
-       fun test_example_glob_route do
+       fun test_example_glob_route is test do
                var app = new App
                app.use("/user/:user/item/:item/*", new UserItem)
                run_test(app)
index 52f818a..813eda4 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_param_route is test_suite
+module test_example_param_route is test
 
 import pop_tests
 import example_param_route
 
 class TestExampleParamRoute
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/Morriar"
@@ -30,7 +31,7 @@ class TestExampleParamRoute
                system "curl -s {host}:{port}/not_found/not_found"
        end
 
-       fun test_example_param_route do
+       fun test_example_param_route is test do
                var app = new App
                app.use("/:user", new UserHome)
                run_test(app)
index 55d5ed9..e0c3082 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_router is test_suite
+module test_example_router is test
 
 import pop_tests
 import example_router
 
 class TestExampleRouter
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}"
@@ -33,7 +34,7 @@ class TestExampleRouter
                system "curl -s {host}:{port}/products/not_found"
        end
 
-       fun test_example_router do
+       fun test_example_router is test do
                var user_router = new Router
                user_router.use("/*", new UserLogger)
                user_router.use("/", new UserHomepage)
index 6310171..91a6e8f 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_session is test_suite
+module test_example_session is test
 
 import pop_tests
 import example_session
 
 class TestExampleSession
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
@@ -30,7 +31,7 @@ class TestExampleSession
                system "curl -s {host}:{port}/products/not_found"
        end
 
-       fun test_example_session do
+       fun test_example_session is test do
                var app = new App
                app.use("/*", new SessionInit)
                app.use("/", new AppLogin)
index a1c26a9..b65bcd6 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_static is test_suite
+module test_example_static is test
 
 import pop_tests
 import example_static
 
 class TestExampleStatic
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/css/style.css"
@@ -32,7 +33,7 @@ class TestExampleStatic
                system "curl -s {host}:{port}/not_found.nit"
        end
 
-       fun test_example_static do
+       fun test_example_static is test do
                var app = new App
                app.use("/", new StaticHandler(test_path / "../public/"))
                run_test(app)
index 30ef93e..3f9ce22 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_static_default is test_suite
+module test_example_static_default is test
 
 import pop_tests
 import example_static_default
 
 class TestExampleStaticDefault
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/css/style.css"
@@ -32,7 +33,7 @@ class TestExampleStaticDefault
                system "curl -s {host}:{port}/not_found.nit"
        end
 
-       fun test_example_static_default do
+       fun test_example_static_default is test do
                var app = new App
                app.use("/", new StaticHandler(test_path / "../public/", "default.html"))
                run_test(app)
index 42fc7df..3d4d2d9 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_static_multiple is test_suite
+module test_example_static_multiple is test
 
 import pop_tests
 import example_static_multiple
 
 class TestExampleStaticMultiple
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/css/style.css"
@@ -36,7 +37,7 @@ class TestExampleStaticMultiple
                system "curl -s {host}:{port}/not_found.nit"
        end
 
-       fun test_example_static_multiple do
+       fun test_example_static_multiple is test do
                var app = new App
                app.use("/", new StaticHandler(test_path / "../public/"))
                app.use("/", new StaticHandler(test_path / "../files/"))
index 3334320..fb88bf1 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_example_templates is test_suite
+module test_example_templates is test
 
 import pop_tests
 intrude import example_templates
 
 class TestExampleTemplate
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
        end
 
-       fun test_example_template do
+       fun test_example_template is test do
                var app = new App
                app.use("/", new MyTemplateHandler)
                run_test(app)
@@ -35,12 +36,13 @@ end
 
 class TestExampleTemplateString
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
        end
 
-       fun test_example_template_string do
+       fun test_example_template_string is test do
                var app = new App
                app.use("/", new MyTemplateStringHandler)
                run_test(app)
@@ -49,12 +51,13 @@ end
 
 class TestExampleTemplateFile
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
        end
 
-       fun test_example_template_file do
+       fun test_example_template_file is test do
                var app = new App
                var handler = new MyTemplateFileHandler
                handler.tpl_file = test_path / "../example_template.tpl"
@@ -65,12 +68,13 @@ end
 
 class TestExampleTemplatePug
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
        end
 
-       fun test_example_template_pug do
+       fun test_example_template_pug is test do
                var app = new App
                app.use("/", new MyTemplatePugHandler)
                run_test(app)
@@ -79,12 +83,13 @@ end
 
 class TestExampleTemplatePugFile
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}/"
        end
 
-       fun test_example_template_pug_file do
+       fun test_example_template_pug_file is test do
                var app = new App
                var handler = new MyTemplatePugFileHandler
                handler.pug_file = test_path / "../example_template.pug"
index 6c5985d..5d89e59 100644 (file)
 # Here we use `curl` to access some URI on the app.
 #
 # ~~~nitish
-# module test_example_hello is test_suite
+# module test_example_hello is test
 #
 # import pop_tests
 # import example_hello
 #
 # class TestExampleHello
 #      super TestPopcorn
+#      test
 #
-#      fun test_example_hello do
+#      fun example_hello is test do
 #              var app = new App
 #              app.use("/", new HelloHandler)
 #              run_test(app)
@@ -68,7 +69,6 @@
 # See `examples/hello_world` for the complete example.
 module pop_tests
 
-import test_suite
 import popcorn
 import pthreads
 
@@ -123,7 +123,6 @@ end
 
 # TestSuite for Popcorn blackbox testing.
 class TestPopcorn
-       super TestSuite
 
        # Host used to run App.
        var host: String = test_host
index 9ad37a5..9c81cce 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_pop_routes is test_suite
+module test_pop_routes is test
 
 import pop_routes
-import test_suite
 
 class TestAppRoute
-       super TestSuite
+       test
 
-       fun test_root_match_only_one_uri do
+       fun test_root_match_only_one_uri is test do
                var r = new AppRoute("/")
                assert r.match("")
                assert r.match("/")
                assert not r.match("/user")
        end
 
-       fun test_strict_route_match_only_one_uri do
+       fun test_strict_route_match_only_one_uri is test do
                var r = new AppRoute("/user")
                assert not r.match("/")
                assert r.match("/user")
@@ -40,9 +39,9 @@ class TestAppRoute
 end
 
 class TestAppParamRoute
-       super TestSuite
+       test
 
-       fun test_param_route_match_good_uri_params_1 do
+       fun test_param_route_match_good_uri_params_1 is test do
                var r = new AppParamRoute("/:id")
                assert not r.match("/")
                assert r.match("/user")
@@ -50,7 +49,7 @@ class TestAppParamRoute
                assert not r.match("/user/10")
        end
 
-       fun test_param_route_match_good_uri_params_2 do
+       fun test_param_route_match_good_uri_params_2 is test do
                var r = new AppParamRoute("/user/:id")
                assert not r.match("/")
                assert not r.match("/user")
@@ -60,7 +59,7 @@ class TestAppParamRoute
                assert not r.match("/user/10/profile")
        end
 
-       fun test_param_route_match_good_uri_params_3 do
+       fun test_param_route_match_good_uri_params_3 is test do
                var r = new AppParamRoute("/user/:id/profile")
                assert not r.match("/")
                assert not r.match("/user")
@@ -73,7 +72,7 @@ class TestAppParamRoute
                assert not r.match("/user/10/foo")
        end
 
-       fun test_param_route_match_good_uri_params_4 do
+       fun test_param_route_match_good_uri_params_4 is test do
                var r = new AppParamRoute("/:id/:foo")
                assert not r.match("/")
                assert not r.match("/user")
@@ -83,7 +82,7 @@ class TestAppParamRoute
                assert not r.match("/user/10/10")
        end
 
-       fun test_param_route_match_good_uri_params_5 do
+       fun test_param_route_match_good_uri_params_5 is test do
                var r = new AppParamRoute("/user/:id/:foo")
                assert not r.match("/")
                assert not r.match("/user")
@@ -94,7 +93,7 @@ class TestAppParamRoute
                assert not r.match("/user/10/10/profile")
        end
 
-       fun test_param_route_match_good_uri_params_6 do
+       fun test_param_route_match_good_uri_params_6 is test do
                var r = new AppParamRoute("/user/:id/settings/:foo")
                assert not r.match("/")
                assert not r.match("/user")
@@ -110,30 +109,30 @@ class TestAppParamRoute
 end
 
 class TestRouteMatching
-       super TestSuite
+       test
 
-       fun test_glob_route_match_good_uri_prefix1 do
+       fun test_glob_route_match_good_uri_prefix1 is test do
                var r = new AppGlobRoute("/*")
                assert r.match("/")
                assert r.match("/user")
                assert r.match("/user/10")
        end
 
-       fun test_glob_route_match_good_uri_prefix2 do
+       fun test_glob_route_match_good_uri_prefix2 is test do
                var r = new AppGlobRoute("/user/*")
                assert not r.match("/")
                assert r.match("/user")
                assert r.match("/user/10")
        end
 
-       fun test_glob_route_match_good_uri_prefix3 do
+       fun test_glob_route_match_good_uri_prefix3 is test do
                var r = new AppGlobRoute("/user*")
                assert not r.match("/")
                assert r.match("/user")
                assert r.match("/user/10")
        end
 
-       fun test_glob_route_work_with_parameters_1 do
+       fun test_glob_route_work_with_parameters_1 is test do
                var r = new AppGlobRoute("/:id/*")
                assert not r.match("/")
                assert r.match("/user")
@@ -141,14 +140,14 @@ class TestRouteMatching
                assert r.match("/user/10/profile")
        end
 
-       fun test_glob_route_work_with_parameters_2 do
+       fun test_glob_route_work_with_parameters_2 is test do
                var r = new AppGlobRoute("/:id*")
                assert not r.match("/")
                assert r.match("/user")
                assert r.match("/user/10")
        end
 
-       fun test_glob_route_work_with_parameters_3 do
+       fun test_glob_route_work_with_parameters_3 is test do
                var r = new AppGlobRoute("/user/:id/*")
                assert not r.match("/")
                assert not r.match("/user")
@@ -156,7 +155,7 @@ class TestRouteMatching
                assert r.match("/user/10/profile")
        end
 
-       fun test_glob_route_work_with_parameters_4 do
+       fun test_glob_route_work_with_parameters_4 is test do
                var r = new AppGlobRoute("/user/:id*")
                assert not r.match("/")
                assert not r.match("/user")
index 108eb7a..d2daed4 100644 (file)
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_popcorn is test_suite
+module test_popcorn is test
 
 import pop_tests
 import popcorn
@@ -29,6 +29,7 @@ end
 
 class TestPopcornRouter
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}"
@@ -44,7 +45,7 @@ class TestPopcornRouter
                system "curl -s {host}:{port}/products/not_found"
        end
 
-       fun test_router do
+       fun test_router is test do
                var app = new App
                app.use("/", new TestHandler("/"))
                app.use("/about", new TestHandler("/about"))
@@ -65,6 +66,7 @@ end
 
 class TestPopcornRoutes
        super TestPopcorn
+       test
 
        redef fun client_test do
                system "curl -s {host}:{port}"
@@ -84,7 +86,7 @@ class TestPopcornRoutes
                system "curl -s {host}:{port}/user/id/not_found"
        end
 
-       fun test_routes do
+       fun test_routes is test do
                var app = new App
                app.use("/", new TestHandler("/"))
                app.use("/user", new TestHandler("/user"))
index 27c98c4..12c7b57 100644 (file)
@@ -9,13 +9,12 @@
 # another product.
 
 # Test suite for `attributes_impl`.
-module test_attributes_impl is test_suite
+module test_attributes_impl is test
 
-import test_suite
 import sax::helpers::attributes_impl
 
 class TestAttributesImpl
-       super TestSuite
+       test
 
        private fun sample: AttributesImpl do
                var subject = new AttributesImpl
@@ -32,7 +31,7 @@ class TestAttributesImpl
                return subject
        end
 
-       fun test_length do
+       fun test_length is test do
                var subject = new AttributesImpl
 
                assert 0 == subject.length
@@ -47,7 +46,7 @@ class TestAttributesImpl
                assert 0 == subject.length
        end
 
-       fun test_uri do
+       fun test_uri is test do
                var subject = sample
 
                assert "http://example.com/" == subject.uri(0)
@@ -60,7 +59,7 @@ class TestAttributesImpl
                assert subject.uri(0) == null
        end
 
-       fun test_local_name do
+       fun test_local_name is test do
                var subject = sample
 
                assert "bar" == subject.local_name(0)
@@ -73,7 +72,7 @@ class TestAttributesImpl
                assert subject.local_name(0) == null
        end
 
-       fun test_qname do
+       fun test_qname is test do
                var subject = sample
 
                assert "foo:bar" == subject.qname(0)
@@ -86,7 +85,7 @@ class TestAttributesImpl
                assert subject.qname(0) == null
        end
 
-       fun test_type_of do
+       fun test_type_of is test do
                var subject = sample
 
                assert "CDATA" == subject.type_of(0)
@@ -99,7 +98,7 @@ class TestAttributesImpl
                assert subject.type_of(0) == null
        end
 
-       fun test_type_of_qname do
+       fun test_type_of_qname is test do
                var subject = sample
 
                assert "CDATA" == subject.type_of("foo:bar")
@@ -111,7 +110,7 @@ class TestAttributesImpl
                assert subject.type_of("xml:lang") == null
        end
 
-       fun test_value_of do
+       fun test_value_of is test do
                var subject = sample
 
                assert "baz" == subject.value_of(0)
@@ -124,7 +123,7 @@ class TestAttributesImpl
                assert subject.value_of(0) == null
        end
 
-       fun test_value_of_qname do
+       fun test_value_of_qname is test do
                var subject = sample
 
                assert "baz" == subject.value_of("foo:bar")
@@ -136,7 +135,7 @@ class TestAttributesImpl
                assert subject.value_of("xml:lang") == null
        end
 
-       fun test_index_ns do
+       fun test_index_ns is test do
                var subject = sample
 
                assert 0 == subject.index_ns("http://example.com/", "bar")
@@ -148,7 +147,7 @@ class TestAttributesImpl
                assert -1 == subject.index_ns("http://example.com/", "bar")
        end
 
-       fun test_index_of do
+       fun test_index_of is test do
                var subject = sample
 
                assert 0 == subject.index_of("foo:bar")
@@ -160,7 +159,7 @@ class TestAttributesImpl
                assert -1 == subject.index_of("foo:bar")
        end
 
-       fun test_type_ns do
+       fun test_type_ns is test do
                var subject = sample
 
                assert "CDATA" == subject.type_ns("http://example.com/", "bar")
@@ -172,7 +171,7 @@ class TestAttributesImpl
                assert subject.type_ns("http://example.com/", "bar") == null
        end
 
-       fun test_value_ns do
+       fun test_value_ns is test do
                var subject = sample
 
                assert "baz" == subject.value_ns("http://example.com/", "bar")
@@ -184,7 +183,7 @@ class TestAttributesImpl
                assert subject.value_ns("http://example.com/", "bar") == null
        end
 
-       fun test_attributes_set do
+       fun test_attributes_set is test do
                var subject = sample
                var subject2 = new AttributesImpl
 
@@ -195,7 +194,7 @@ class TestAttributesImpl
                assert subject.length == 4
        end
 
-       fun test_set do
+       fun test_set is test do
                var subject = sample
 
                subject.set(1, "urn:is:not:often:used", "i-am_ME", "i-am_ME", "ID",
@@ -205,7 +204,7 @@ class TestAttributesImpl
                assert "NMTOKENS" == subject.type_of(0)
        end
 
-       fun test_remove_at do
+       fun test_remove_at is test do
                var subject = sample
 
                subject.remove_at(1)
@@ -213,7 +212,7 @@ class TestAttributesImpl
                assert "xml:lang" == subject.qname(1)
        end
 
-       fun test_uri_set do
+       fun test_uri_set is test do
                var subject = sample
 
                subject.uri(0) = "https://example.org/serious"
@@ -222,7 +221,7 @@ class TestAttributesImpl
                assert "https://example.org/serious" == subject.uri(0)
        end
 
-       fun test_local_name_set do
+       fun test_local_name_set is test do
                var subject = sample
 
                subject.local_name(0) = "trololol"
@@ -231,7 +230,7 @@ class TestAttributesImpl
                assert "ImYou42" == subject.local_name(1)
        end
 
-       fun test_qname_set do
+       fun test_qname_set is test do
                var subject = sample
 
                subject.qname(0) = "go-to:bar"
@@ -240,7 +239,7 @@ class TestAttributesImpl
                assert "yo:i-am_ME" == subject.qname(1)
        end
 
-       fun test_type_of_set do
+       fun test_type_of_set is test do
                var subject = sample
 
                subject.type_of(0) = "NMTOKENS"
@@ -249,7 +248,7 @@ class TestAttributesImpl
                assert "ENTITY" == subject.type_of(1)
        end
 
-       fun test_value_of_set do
+       fun test_value_of_set is test do
                var subject = sample
 
                subject.value_of(0) = "buz"
index 3892e12..ed25c75 100644 (file)
@@ -9,13 +9,12 @@
 # another product.
 
 # Test suite for `namespace_support`.
-module test_namespace_support is test_suite
+module test_namespace_support is test
 
-import test_suite
 import sax::helpers::namespace_support
 
 class TestNamespaceSupport
-       super TestSuite
+       test
 
        private fun sample: NamespaceSupport do
                var subject = new NamespaceSupport
@@ -26,7 +25,7 @@ class TestNamespaceSupport
                return subject
        end
 
-       fun test_reset do
+       fun test_reset is test do
                var subject = sample
 
                subject.reset
@@ -37,7 +36,7 @@ class TestNamespaceSupport
                assert 2 == subject.prefixes.length
        end
 
-       fun test_push_context_override_default do
+       fun test_push_context_override_default is test do
                var subject = sample
 
                subject.push_context
@@ -51,7 +50,7 @@ class TestNamespaceSupport
                assert 3 == subject.prefixes.length
        end
 
-       fun test_push_context_override_dc do
+       fun test_push_context_override_dc is test do
                var subject = sample
 
                subject.push_context
@@ -64,7 +63,7 @@ class TestNamespaceSupport
                assert 3 == subject.prefixes.length
        end
 
-       fun test_push_context_undeclare do
+       fun test_push_context_undeclare is test do
                var subject = sample
 
                subject.push_context
@@ -74,7 +73,7 @@ class TestNamespaceSupport
                assert 2 == subject.prefixes.length
        end
 
-       fun test_pop_context do
+       fun test_pop_context is test do
                var subject = sample
 
                subject.pop_context
@@ -86,7 +85,7 @@ class TestNamespaceSupport
 
        #fun test_declare_prefix # SEE: test_push_context_*
 
-       fun test_process_name do
+       fun test_process_name is test do
                var subject = sample
                var parts = new Array[String]
 
@@ -104,7 +103,7 @@ class TestNamespaceSupport
                assert ["", "p", "p"] == subject.process_name("p", parts, true)
        end
 
-       fun test_process_name_xmlns do
+       fun test_process_name_xmlns is test do
                var subject = sample
                var parts = new Array[String].with_capacity(3)
 
@@ -112,7 +111,7 @@ class TestNamespaceSupport
                assert ["http://www.w3.org/1999/xhtml", "xmlns", "xmlns"] == subject.process_name("xmlns", parts, false)
        end
 
-       fun test_declare_prefix_illegal do
+       fun test_declare_prefix_illegal is test do
                var subject = sample
 
                assert not subject.declare_prefix("xml", "http://example.org")
@@ -122,7 +121,7 @@ class TestNamespaceSupport
                assert 2 == subject.declared_prefixes.length
        end
 
-       fun test_uri do
+       fun test_uri is test do
                var subject = sample
 
                assert "http://www.w3.org/1999/xhtml" == subject.uri("")
@@ -131,7 +130,7 @@ class TestNamespaceSupport
                assert subject.uri("foo") == null
        end
 
-       fun test_prefixes do
+       fun test_prefixes is test do
                var res = sample.prefixes
 
                assert 3 == res.length else
@@ -142,7 +141,7 @@ class TestNamespaceSupport
                assert res.has("xmlns")
        end
 
-       fun test_prefix do
+       fun test_prefix is test do
                var subject = sample
 
                assert subject.prefix("http://www.w3.org/1999/xhtml") == null
@@ -151,7 +150,7 @@ class TestNamespaceSupport
                assert subject.prefix("https://example.org/serious") == null
        end
 
-       fun test_prefixes_of do
+       fun test_prefixes_of is test do
                var subject = sample
                var res: Collection[String]
 
@@ -169,7 +168,7 @@ class TestNamespaceSupport
                assert res.has_all(["dc", "dc2"])
        end
 
-       fun test_declared_prefixes do
+       fun test_declared_prefixes is test do
                var res = sample.declared_prefixes
 
                assert 2 == res.length else
index c4afbbf..98ddc26 100644 (file)
@@ -9,7 +9,7 @@
 # another product.
 
 # Tests for SAXophoNit
-module test_saxophonit is test_suite
+module test_saxophonit is test
 
 import sax::helpers::sax_locator_impl
 import sax::helpers::attributes_impl
@@ -18,10 +18,11 @@ import saxophonit::testing
 
 class TestSaxophonit
        super SAXTestSuite
+       test
 
        redef fun create_reader do return new XophonReader
 
-       fun test_empty do
+       fun test_empty is test do
                before_test
                parse_string("<foo />")
                expected.document_locator = new SAXLocatorImpl
@@ -32,7 +33,7 @@ class TestSaxophonit
                assert_equals
        end
 
-       fun test_simple_element do
+       fun test_simple_element is test do
                before_test
                parse_string("<foo>bar</foo>")
                expected.document_locator = new SAXLocatorImpl
@@ -44,7 +45,7 @@ class TestSaxophonit
                assert_equals
        end
 
-       fun test_type_mismatch do
+       fun test_type_mismatch is test do
                before_test
                parse_string("<a></b>")
                expected.document_locator = new SAXLocatorImpl
@@ -57,7 +58,7 @@ class TestSaxophonit
                assert_equals
        end
 
-       fun test_attributes do
+       fun test_attributes is test do
                var atts = new AttributesImpl
 
                before_test
@@ -72,7 +73,7 @@ class TestSaxophonit
                assert_equals
        end
 
-       fun test_nested do
+       fun test_nested is test do
                var atts = new AttributesImpl
 
                before_test
@@ -90,7 +91,7 @@ class TestSaxophonit
                assert_equals
        end
 
-       fun test_xmldecl do
+       fun test_xmldecl is test do
                before_test
                parse_string("<?xml version='1.0'?><foo />")
                expected.document_locator = new SAXLocatorImpl
@@ -101,7 +102,7 @@ class TestSaxophonit
                assert_equals
        end
 
-       fun test_xmldecl_encoding do
+       fun test_xmldecl_encoding is test do
                before_test
                parse_string("<?xml version=\"1.0\" encoding='utf-8'?><foo />")
                expected.document_locator = new SAXLocatorImpl
@@ -112,7 +113,7 @@ class TestSaxophonit
                assert_equals
        end
 
-       fun test_xmldecl_standalone do
+       fun test_xmldecl_standalone is test do
                before_test
                parse_string("<?xml version='1.0' standalone=\"yes\"?><foo />")
                expected.document_locator = new SAXLocatorImpl
@@ -123,7 +124,7 @@ class TestSaxophonit
                assert_equals
        end
 
-       fun test_xmldecl_both do
+       fun test_xmldecl_both is test do
                before_test
                parse_string("<?xml version='1.0' encoding='utf-8' standalone=\"yes\"?><foo />")
                expected.document_locator = new SAXLocatorImpl
@@ -134,7 +135,7 @@ class TestSaxophonit
                assert_equals
        end
 
-       fun test_reference_builtin do
+       fun test_reference_builtin is test do
                before_test
                parse_string("<foo>&amp;&quot;&apos;&lt;&gt;&#48;&#x30;&#x03A;</foo>")
                expected.document_locator = new SAXLocatorImpl
@@ -153,7 +154,7 @@ class TestSaxophonit
                assert_equals
        end
 
-       fun test_comments do
+       fun test_comments is test do
                # TODO For the moment, comments are simply ignored.
                before_test
                parse_string("<!-- I--><foo>bar<!--l-i-k-e--></foo><!--comments    -->")
@@ -166,7 +167,7 @@ class TestSaxophonit
                assert_equals
        end
 
-       fun test_ns_simple do
+       fun test_ns_simple is test do
                before_test
                parse_string("<foo:bar xmlns:foo='https://s.exemple.org' />")
                expected.document_locator = new SAXLocatorImpl
@@ -178,7 +179,7 @@ class TestSaxophonit
                assert_equals
        end
 
-       fun test_ns_prefix do
+       fun test_ns_prefix is test do
                var atts = new AttributesImpl
 
                before_test
@@ -194,7 +195,7 @@ class TestSaxophonit
                assert_equals
        end
 
-       fun test_mixed do
+       fun test_mixed is test do
                var atts = new AttributesImpl
 
                # TODO For the moment, ignorable white space is not detected.
index c2ace75..c9c7fc1 100644 (file)
@@ -9,13 +9,12 @@
 # another product.
 
 # Test suite for `testing`.
-module test_testing is test_suite
+module test_testing is test
 
 import saxophonit::testing
-import test_suite
 
 class TestSaxEventLogger
-       super TestSuite
+       test
 
        # Constants for diff formatting.
 
@@ -40,8 +39,7 @@ class TestSaxEventLogger
 
        private var init_done: Bool = false
 
-       redef fun before_test do
-               super
+       fun before_test is before do
                if not init_done then
                        default = a.term_default
                        ins = a.term_insertion
@@ -64,19 +62,19 @@ class TestSaxEventLogger
                end
        end
 
-       fun test_diff_empty do
+       fun test_diff_empty is test do
                assert "" == a.diff(b).to_s
                assert "" == b.diff(a).to_s
        end
 
-       fun test_diff_equal1 do
+       fun test_diff_equal1 is test do
                b.start_document
                a.start_document
                assert "" == a.diff(b).to_s
                assert "" == b.diff(a).to_s
        end
 
-       fun test_diff_equal2 do
+       fun test_diff_equal2 is test do
                b.start_document
                b.end_document
                a.start_document
@@ -85,7 +83,7 @@ class TestSaxEventLogger
                assert "" == b.diff(a).to_s
        end
 
-       fun test_diff_insertion do
+       fun test_diff_insertion is test do
                var exp: String
                var test: String
 
@@ -115,7 +113,7 @@ class TestSaxEventLogger
                assert_equals(2, exp, test)
        end
 
-       fun test_diff_edition do
+       fun test_diff_edition is test do
                var exp: String
                var test: String
 
index cc69c83..a5af113 100644 (file)
@@ -17,7 +17,6 @@ import sax::helpers::xml_filter_impl
 import sax::ext::decl_handler
 import sax::ext::lexical_handler
 import console
-import test_suite
 
 # A filter that internally log events it recieves.
 #
@@ -532,7 +531,6 @@ end
 
 # Base class for test suites on a SAX reader.
 abstract class SAXTestSuite
-       super TestSuite
 
        # Logger of the expected event sequence.
        var expected = new SAXEventLogger
@@ -545,8 +543,7 @@ abstract class SAXTestSuite
 
        private var init_done: Bool = false
 
-       redef fun before_test do
-               super
+       fun before_test is before do
                if not init_done then
                        reader = create_reader
                        actual.parent = reader
index b2854e6..c6cd512 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_macro is test_suite
+module test_macro is test
 
-import test_suite
 import macro
 
 class TestTemplateString
-       super TestSuite
+       test
 
-       fun test_tpl_parse_1 do
+       fun test_tpl_parse_1 is test do
                var tpl = """
 <!DOCTYPE html>
 <html lang="en">
@@ -37,7 +36,7 @@ class TestTemplateString
                assert res == tpl
        end
 
-       fun test_tpl_parse_2 do
+       fun test_tpl_parse_2 is test do
                var tpl = """
 <!DOCTYPE html>
 <html lang="en">
@@ -54,7 +53,7 @@ class TestTemplateString
                assert res == tpl
        end
 
-       fun test_tpl_parse_3 do
+       fun test_tpl_parse_3 is test do
                var tpl = """
 <!DOCTYPE html>
 <html lang="en">
@@ -67,7 +66,7 @@ class TestTemplateString
                assert res == tpl
        end
 
-       fun test_tpl_parse_4 do
+       fun test_tpl_parse_4 is test do
                var tpl = """
 <!DOCTYPE html>
 <html lang="en">
@@ -83,7 +82,7 @@ class TestTemplateString
                assert res == tpl
        end
 
-       fun test_tpl_parse_5 do
+       fun test_tpl_parse_5 is test do
                var tpl = """
 <!DOCTYPE html>
 <html lang="en">
@@ -100,7 +99,7 @@ class TestTemplateString
                assert res == tpl
        end
 
-       fun test_tpl_parse_6 do
+       fun test_tpl_parse_6 is test do
                var tpl = """
 <!DOCTYPE html>
 <html lang="en">
@@ -116,7 +115,7 @@ class TestTemplateString
                assert res == tpl
        end
 
-       fun test_tpl_replace_1 do
+       fun test_tpl_replace_1 is test do
                var tpl = """
 <!DOCTYPE html>
 <html lang="en">
@@ -145,7 +144,7 @@ class TestTemplateString
                assert res == exp
        end
 
-       fun test_tpl_replace_2 do
+       fun test_tpl_replace_2 is test do
                var tpl = """
 <!DOCTYPE html>
 <html lang="en">
@@ -175,7 +174,7 @@ class TestTemplateString
                assert res == exp
        end
 
-       fun test_tpl_replace_3 do
+       fun test_tpl_replace_3 is test do
                var tpl = """
 <!DOCTYPE html>
 <html lang="en">
diff --git a/lib/test_suite.ini b/lib/test_suite.ini
deleted file mode 100644 (file)
index a32a29c..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-[package]
-name=test_suite
-tags=devel,lib
-maintainer=Alexandre Terrasa <alexandre@moz-code.org>
-license=Apache-2.0
-[upstream]
-browse=https://github.com/nitlang/nit/tree/master/lib/test_suite.nit
-git=https://github.com/nitlang/nit.git
-git.directory=lib/test_suite.nit
-homepage=http://nitlanguage.org
-issues=https://github.com/nitlang/nit/issues
diff --git a/lib/test_suite.nit b/lib/test_suite.nit
deleted file mode 100644 (file)
index e7b6f3a..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-# 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.
-
-# Common interface for `nitunit` test-suites.
-module test_suite is
-       # Annotation used by test-suite modules.
-       new_annotation test_suite
-end
-
-# A test-suite that can be executed by `nitunit`.
-#
-# All test-suite classes must implement `TestSuite`.
-class TestSuite
-       # Internal empty init.
-       private init nitunit do end
-
-       # Method called before each test-case.
-       #
-       # Redefine this method to factorize code that have to be
-       # executed before every test.
-       fun before_test do end
-
-       # Method called after each test-case.
-       #
-       # Redefine this method to factorize code that have to be
-       # executed after every test.
-       fun after_test do end
-end
-
-redef class Sys
-       # Internal empty init.
-       private init nitunit do end
-
-       # No before test for the module
-       private fun before_test do end
-
-       # No after test for the module
-       private fun after_test do end
-
-       # Method called before each test-suite.
-       #
-       # Redefine this method to factorize code that have to be
-       # executed before every test suite.
-       fun before_module do end
-
-       # Method called after each test-suite.
-       #
-       # Redefine this method to factorize code that have to be
-       # executed after every test suite.
-       fun after_module do end
-end
index 0ab13a5..2263bd3 100644 (file)
@@ -131,25 +131,24 @@ This flag can be used by libraries and program to prevent (or limit) the executi
 
 TestSuites are Nit modules that define a set of TestCases.
 
-A test suite is a module that uses the annotation `is test_suite`.
+A test suite is a module that uses the annotation `is test`.
 
 It is common that a test suite focuses on testing a single module.
-In this case, the name of the test_suite is often `test_foo.nit` where `foo.nit` is the tested module.
+In this case, the name of the test suite is often `test_foo.nit` where `foo.nit` is the tested module.
 
 The structure of a test suite is the following:
 
 ~~~~
 # test suite for module `foo`
-module test_foo is test_suite
+module test_foo is test
 
-import test_suite
 import foo # can be intrude to test private things
 
 class TestFoo
-       super TestSuite
+    test
 
     # test case for `foo::Foo::baz`
-    fun test_baz do
+    fun baz is test do
         var subject = new Foo
         assert subject.baz(1, 2) == 3
     end
@@ -160,18 +159,18 @@ Test suite can be executed using the same `nitunit` command:
 
     $ nitunit foo.nit
 
-`nitunit` will execute a test for each method named `test_*` in a class
-subclassing `TestSuite` so multiple tests can be executed for a single method:
+`nitunit` will execute a test for each method with the `test` annotation in a class
+also annotated with `test` so multiple tests can be executed for a single method:
 
 ~~~~
 class TestFoo
-       super TestSuite
+    test
 
-    fun test_baz_1 do
+    fun baz_1 is test do
         var subject = new Foo
         assert subject.baz(1, 2) == 3
     end
-    fun test_baz_2 do
+    fun baz_2 is test do
         var subject = new Foo
         assert subject.baz(1, -2) == -1
     end
@@ -204,12 +203,12 @@ The `diff(1)` command is used to perform the comparison.
 The test is failed if non-zero is returned by `diff`.
 
 ~~~
-module test_mod is test_suite
+module test_mod is test
 
 class TestFoo
-       super TestSuite
+       test
 
-       fun test_bar do
+       fun bar is test do
                print "Hello!"
        end
 end
@@ -228,25 +227,27 @@ To helps the management of the expected results, the option `--autosav` can be u
 
 ## Configuring TestSuites
 
-`TestSuite`s also provide methods to configure the test run:
-
-`before_test` and `after_test`: methods called before/after each test case.
+`TestSuite`s also provide annotations to configure the test run:
+`before` and `after` annotations can be applied to methods that must be called before/after each test case.
 They can be used to factorize repetitive tasks:
 
 ~~~~
 class TestFoo
-       super TestSuite
+    test
+
     var subject: Foo
+
     # Mandatory empty init
     init do end
+
     # Method executed before each test
-    fun before_test do
+    fun set_up is before do
         subject = new Foo
     end
-    fun test_baz_1 do
+    fun baz_1 is test do
         assert subject.baz(1, 2) == 3
     end
-    fun test_baz_2 do
+    fun baz_2 is test do
         assert subject.baz(1, -2) == -1
     end
 end
@@ -254,7 +255,7 @@ end
 
 When using custom test attributes, an empty `init` must be declared to allow automatic test running.
 
-`before_module` and `after_module`: methods called before/after each test suite.
+`before_all` and `after_all` annotations can be applied to methods that must be called before/after each test suite.
 They have to be declared at top level:
 
 ~~~~
@@ -279,11 +280,11 @@ end
 The `NIT_TESTING_PATH` environment variable contains the current test suite
 file path.
 Nitunit define this variable before the execution of each test suite.
-It can be used to access files based on the current test_suite location:
+It can be used to access files based on the current test suite location:
 
 ~~~
 class TestWithPath
-       super TestSuite
+    test
 
     fun test_suite_path do
         assert "NIT_TESTING_PATH".environ != ""
index 92510bc..51cdd53 100644 (file)
@@ -384,7 +384,7 @@ class Catalog
                                        end
                                end
                                var ms = gs
-                               if m.is_test_suite then ms /= 100.0
+                               if m.is_test then ms /= 100.0
                                entity_score += ms
                                if m.mdoc != null then doc_score += ms else ms /= 10.0
                                for cd in m.mclassdefs do
index 867afcf..0fc7008 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_coloring is test_suite
+module test_coloring is test
 
-import test_suite
 import coloring
 
 class TestPOSetColorer
-       super TestSuite
+       test
 
-       fun test_ids_strictly_positive do
+       fun test_ids_strictly_positive is test do
                var poset = new POSet[String]
                poset.add_node "A"
 
index 97efb63..54d9a01 100644 (file)
@@ -48,8 +48,8 @@ private class NoWarningPhase
 
                var modelbuilder = toolcontext.modelbuilder
 
-               # Disable `missing-doc` for `test_suite`
-               if source != null and not nmoduledecl.get_annotations("test_suite").is_empty then
+               # Disable `missing-doc` for `test`
+               if source != null and not nmoduledecl.get_annotations("test").is_empty then
                        toolcontext.warning_blacklist[source].add("missing-doc")
                end
 
index b2a9687..409a994 100644 (file)
@@ -106,12 +106,26 @@ end
 
 redef class MModule
        super AnnotatedMEntity
+
+       redef var is_test is lazy do return has_annotation("test")
 end
 
 redef class MClassDef
        super AnnotatedMEntity
+
+       redef var is_test is lazy do return has_annotation("test")
 end
 
 redef class MPropDef
        super AnnotatedMEntity
+
+       redef var is_test is lazy do return has_annotation("test")
+
+       redef var is_before is lazy do return has_annotation("before")
+
+       redef var is_before_all is lazy do return has_annotation("before_all")
+
+       redef var is_after is lazy do return has_annotation("after")
+
+       redef var is_after_all is lazy do return has_annotation("after_all")
 end
index 615aba9..125866a 100644 (file)
@@ -812,8 +812,6 @@ redef class ModelBuilder
                                mmodule.mdoc = mdoc
                                mdoc.original_mentity = mmodule
                        end
-                       # Is the module a test suite?
-                       mmodule.is_test_suite = not decl.get_annotations("test_suite").is_empty
                        # Is the module generated?
                        mmodule.is_generated = not decl.get_annotations("generated").is_empty
                end
index 9d1fb9c..a410236 100644 (file)
@@ -248,9 +248,6 @@ class MModule
                end
        end
 
-       # Is `self` a unit test module used by `nitunit`?
-       var is_test_suite: Bool = false is writable
-
        # Is `self` a module generated by a tool?
        #
        # This flag has no effect on the semantic.
index 935b201..47900c5 100644 (file)
@@ -588,6 +588,8 @@ class MClass
        # Is `self` and abstract class?
        var is_abstract: Bool is lazy do return kind == abstract_kind
 
+       redef var is_test is lazy do return intro.is_test
+
        redef fun mdoc_or_fallback
        do
                # Don’t use `intro.mdoc_or_fallback` because it would create an infinite
@@ -2327,6 +2329,20 @@ abstract class MProperty
        end
 
        private var lookup_all_definitions_cache = new HashMap2[MModule, MType, Array[MPROPDEF]]
+
+       redef var is_test is lazy do return intro.is_test
+
+       # Does self have the `before` annotation?
+       var is_before: Bool is lazy do return intro.is_before
+
+       # Does self have the `before_all` annotation?
+       var is_before_all: Bool is lazy do return intro.is_before_all
+
+       # Does self have the `after` annotation?
+       var is_after: Bool is lazy do return intro.is_after
+
+       # Does self have the `after_all` annotation?
+       var is_after_all: Bool is lazy do return intro.is_after_all
 end
 
 # A global method
@@ -2516,6 +2532,18 @@ abstract class MPropDef
        end
 
        redef fun mdoc_or_fallback do return mdoc or else mproperty.mdoc_or_fallback
+
+       # Does self have the `before` annotation?
+       var is_before = false is writable
+
+       # Does self have the `before_all` annotation?
+       var is_before_all = false is writable
+
+       # Does self have the `after` annotation?
+       var is_after = false is writable
+
+       # Does self have the `after_all` annotation?
+       var is_after_all = false is writable
 end
 
 # A local definition of a method
index 0c136b8..0a0d8b0 100644 (file)
@@ -103,6 +103,11 @@ abstract class MEntity
        # Fictive entities are used internally but they should not be
        # exposed to the final user.
        var is_fictive: Bool = false is writable
+
+       # Is `self` created for unit testing purpose?
+       #
+       # See `nitunit`.
+       var is_test: Bool = false is writable
 end
 
 # Something that represents a concern
index 2f0eed5..8b0f122 100644 (file)
@@ -122,7 +122,7 @@ class ModelView
                v.include_fictive = self.include_fictive
                v.include_empty_doc = self.include_empty_doc
                v.include_attribute = self.include_attribute
-               v.include_test_suite = self.include_test_suite
+               v.include_test = self.include_test
        end
 
        # Searches the MEntity that matches `full_name`.
index 59d3e61..a2807de 100644 (file)
@@ -104,13 +104,13 @@ abstract class ModelVisitor
        # Should we accept nitunit test suites?
        #
        # Default is `false`.
-       var include_test_suite = false is writable
+       var include_test = false is writable
 
        # Can we accept this `mentity` regarding its test suite status?
-       fun accept_test_suite(mentity: MEntity): Bool do
-               if include_test_suite then return true
+       fun accept_test(mentity: MEntity): Bool do
+               if include_test then return true
                if not mentity isa MModule then return true
-               return not mentity.is_test_suite
+               return not mentity.is_test
        end
 
        # Should we accept `MAttribute` instances?
@@ -131,7 +131,7 @@ abstract class ModelVisitor
                if not accept_visibility(mentity) then return false
                if not accept_fictive(mentity) then return false
                if not accept_empty_doc(mentity) then return false
-               if not accept_test_suite(mentity) then return false
+               if not accept_test(mentity) then return false
                if not accept_attribute(mentity) then return false
                return true
        end
index 897dfd5..c544446 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_model_json is test_suite
+module test_model_json is test
 
-import test_suite
 import model_json
 import frontend
 
 class TestModelSerialization
-       super TestSuite
+       test
 
        var suite_path: String = "NIT_TESTING_PATH".environ
        var lib_path: String = "{suite_path.dirname}/../../tests/test_prog"
@@ -35,7 +34,7 @@ class TestModelSerialization
                return model
        end
 
-       fun test_refs_to_full_json do
+       fun test_refs_to_full_json is test do
                var mentities = new Array[MEntity]
                mentities.add model.mpackages.first
                mentities.add model.mmodules.first
@@ -45,13 +44,13 @@ class TestModelSerialization
                end
        end
 
-       fun test_packages_to_full_json do
+       fun test_packages_to_full_json is test do
                for mentity in model.mpackages do
                        print mentity.to_pretty_full_json
                end
        end
 
-       fun test_groups_to_full_json do
+       fun test_groups_to_full_json is test do
                for mpackage in model.mpackages do
                        for mentity in mpackage.mgroups do
                                print mentity.to_pretty_full_json
@@ -59,19 +58,19 @@ class TestModelSerialization
                end
        end
 
-       fun test_modules_to_full_json do
+       fun test_modules_to_full_json is test do
                for mentity in model.mmodules do
                        print mentity.to_pretty_full_json
                end
        end
 
-       fun test_classes_to_full_json do
+       fun test_classes_to_full_json is test do
                for mentity in model.mclasses do
                        print mentity.to_pretty_full_json
                end
        end
 
-       fun test_classdefs_to_full_json do
+       fun test_classdefs_to_full_json is test do
                for mclass in model.mclasses do
                        for mentity in mclass.mclassdefs do
                                print mentity.to_pretty_full_json
@@ -79,13 +78,13 @@ class TestModelSerialization
                end
        end
 
-       fun test_props_to_full_json do
+       fun test_props_to_full_json is test do
                for mentity in model.mproperties do
                        print mentity.to_pretty_full_json
                end
        end
 
-       fun test_propdefs_to_full_json do
+       fun test_propdefs_to_full_json is test do
                for mprop in model.mproperties do
                        for mentity in mprop.mpropdefs do
                                print mentity.to_pretty_full_json
index 772ec38..a0addf1 100644 (file)
@@ -49,20 +49,19 @@ To test a method you have to instanciate its class:
 
 TestSuites are Nit files that define a set of TestCase for a particular module.
 
-The test suite module must be declared using the `test_suite` annotation.
+The test suite module must be declared using the `test` annotation.
 The structure of a test suite is the following:
 
        # test suite for module `foo`
-       module test_foo is test_suite
+       module test_foo is test
 
-       import test_suite # import the `TestSuite` class and the `test_suite` annotation
        import foo # can be intrude to test private things
 
        class TestFoo
-               super TestSuite
+               test
 
                # test case for `foo::Foo::baz`
-               fun test_baz do
+               fun baz is test do
                        var subject = new Foo
                        assert subject.baz(1, 2) == 3
                end
@@ -79,18 +78,18 @@ Otherwise, you can use the `-t` option to specify the test suite module name:
 
        $ nitunit foo.nit -t my_test_suite.nit
 
-`nitunit` will execute a test for each method named `test_*` in a class named `Test*`
+`nitunit` will execute a test for each method annotated with `test` in a class also annotated with `test`
 so multiple tests can be executed for a single method:
 
        class TestFoo
-               super TestSuite
+               test
 
-               fun test_baz_1 do
+               fun baz_1 is test do
                        var subject = new Foo
                        assert subject.baz(1, 2) == 3
                end
 
-               fun test_baz_2 do
+               fun baz_2 is test do
                        var subject = new Foo
                        assert subject.baz(1, -2) == -1
                end
@@ -98,51 +97,50 @@ so multiple tests can be executed for a single method:
 
 `TestSuites` also provide methods to configure the test run:
 
-`before_test` and `after_test`: methods called before/after each test case.
+`before` and `after` annotations can be added to methods that must be called before/after each test case.
 They can be used to factorize repetitive tasks:
 
        class TestFoo
-               super TestSuite
+               test
 
                var subject: Foo is noinit
 
                # Method executed before each test
-               redef fun before_test do
+               redef fun set_up is before do
                        subject = new Foo
                end
 
-               fun test_baz_1 do
+               fun baz_1 is test do
                        assert subject.baz(1, 2) == 3
                end
 
-               fun test_baz_2 do
+               fun baz_2 is test do
                        assert subject.baz(1, -2) == -1
                end
        end
 
 When using custom test attributes, a empty init must be declared to allow automatic test running.
 
-`before_module` and `after_module`: methods called before/after each test suite.
+`before_all` and `after_all` annotations can be set on methods that must be called before/after each test suite.
 They have to be declared at top level:
 
        module test_bdd_connector
 
-       import test_suite
        import bdd_connector
 
        # Testing the bdd_connector
        class TestConnector
-               super TestSuite
+               test
                # test cases using a server
        end
 
        # Method executed before testing the module
-       redef fun before_module do
+       fun before_module is before_all do
                # start server before all test cases
        end
 
        # Method executed after testing the module
-       redef fun after_module do
+       fun after_module is after_all do
                # stop server after all test cases
        end
 
index 2564c5e..a444bee 100644 (file)
@@ -27,9 +27,8 @@ class NitUnitGenerator
        fun gen_unit(mmodule: MModule, test_file: String): Template do
                var with_private = toolcontext.opt_gen_private.value
                var tpl = new Template
-               tpl.addn "module test_{mmodule.name} is test_suite"
+               tpl.addn "module test_{mmodule.name} is test"
                tpl.addn ""
-               tpl.addn "import test_suite"
                if with_private then
                        tpl.addn "intrude import {mmodule.name}"
                else
@@ -39,7 +38,7 @@ class NitUnitGenerator
                        if mclassdef.mclass.kind != concrete_kind then continue
                        tpl.addn ""
                        tpl.addn "class Test{mclassdef.name}"
-                       tpl.addn "\tsuper TestSuite"
+                       tpl.addn "\ttest"
                        for mpropdef in mclassdef.mpropdefs do
                                if not mpropdef isa MMethodDef then continue
                                var mproperty = mpropdef.mproperty
@@ -48,7 +47,7 @@ class NitUnitGenerator
                                if not with_private and mproperty.visibility <= protected_visibility then continue
                                var case_name = case_name(mpropdef)
                                tpl.addn ""
-                               tpl.addn "\tfun {case_name} do"
+                               tpl.addn "\tfun {case_name} is test do"
                                tpl.addn "\t\tassert not_implemented: false # TODO remove once implemented"
                                tpl.addn ""
                                tpl.addn gen_init(mclassdef)
index 295598b..43ac8f5 100644 (file)
@@ -17,7 +17,7 @@ module testing_suite
 
 import testing_base
 import html
-private import annotation
+private import parse_annotations
 private import realtime
 
 redef class ToolContext
@@ -38,29 +38,33 @@ class NitUnitTester
                var toolcontext = mbuilder.toolcontext
                var suite = new TestSuite(mmodule, toolcontext)
                # method to execute before all tests in the module
-               var before_module = mmodule.before_test
-               if before_module != null then
+               for mmethod in mmodule.before_all do
                        toolcontext.modelbuilder.total_tests += 1
-                       suite.before_module = new TestCase(suite, before_module, toolcontext)
+                       suite.before_all.add new TestCase(suite, mmethod, toolcontext)
                end
                # generate all test cases
                for mclassdef in mmodule.mclassdefs do
                        if not mclassdef.is_test then continue
                        if not suite_match_pattern(mclassdef) then continue
                        toolcontext.modelbuilder.total_classes += 1
+
+                       var before = mclassdef.before
+                       var after = mclassdef.after
+
                        for mpropdef in mclassdef.mpropdefs do
                                if not mpropdef isa MMethodDef or not mpropdef.is_test then continue
                                if not case_match_pattern(mpropdef) then continue
                                toolcontext.modelbuilder.total_tests += 1
                                var test = new TestCase(suite, mpropdef, toolcontext)
-                               suite.add_test test
+                               test.before = before
+                               test.after = after
+                               suite.test_cases.add test
                        end
                end
                # method to execute after all tests in the module
-               var after_module = mmodule.after_test
-               if after_module != null then
+               for mmethod in mmodule.after_all do
                        toolcontext.modelbuilder.total_tests += 1
-                       suite.after_module = new TestCase(suite, after_module, toolcontext)
+                       suite.after_all.add new TestCase(suite, mmethod, toolcontext)
                end
                suite.run
                return suite
@@ -113,20 +117,17 @@ 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
+       # Tests to be executed before the whole test suite.
+       var before_all = new Array[TestCase]
 
-       # Test to be executed after the whole test suite.
-       var after_module: nullable TestCase = null
+       # Tests to be executed after the whole test suite.
+       var after_all = new Array[TestCase]
 
        # Display test suite status in std-out.
        fun show_status do
                var test_cases = self.test_cases.to_a
-               if before_module != null then test_cases.add before_module.as(not null)
-               if after_module != null then test_cases.add after_module.as(not null)
+               test_cases.add_all before_all
+               test_cases.add_all after_all
                toolcontext.show_unit_status("Test-suite of module " + mmodule.full_name, test_cases)
        end
 
@@ -152,10 +153,7 @@ class TestSuite
                end
                toolcontext.info("Execute test-suite {mmodule.name}", 1)
 
-               var before_module = self.before_module
-               var after_module = self.after_module
-
-               if before_module != null then
+               for before_module in before_all do
                        before_module.run
                        toolcontext.clear_progress_bar
                        toolcontext.show_unit(before_module)
@@ -165,7 +163,7 @@ class TestSuite
                                        toolcontext.clear_progress_bar
                                        toolcontext.show_unit(case)
                                end
-                               if after_module != null then
+                               for after_module in after_all do
                                        after_module.fail "Nitunit Error: before_module test failed"
                                        toolcontext.clear_progress_bar
                                        toolcontext.show_unit(after_module)
@@ -183,7 +181,7 @@ class TestSuite
                        show_status
                end
 
-               if not after_module == null then
+               for after_module in after_all do
                        after_module.run
                        toolcontext.clear_progress_bar
                        toolcontext.show_unit(after_module)
@@ -197,18 +195,16 @@ class TestSuite
        # Write the test unit for `self` in a nit compilable file.
        fun write_to_nit do
                var file = new Template
-               file.addn "intrude import test_suite"
+               file.addn "intrude import core"
                file.addn "import {mmodule.name}\n"
                file.addn "var name = args.first"
-               var before_module = self.before_module
-               if before_module != null then
+               for before_module in before_all do
                        before_module.write_to_nit(file)
                end
                for case in test_cases do
                        case.write_to_nit(file)
                end
-               var after_module = self.after_module
-               if after_module != null then
+               for after_module in after_all do
                        after_module.write_to_nit(file)
                end
                file.write_to_file("{test_file}.nit")
@@ -272,6 +268,12 @@ class TestCase
        # Test method to be compiled and tested.
        var test_method: MMethodDef
 
+       # Cases to execute before this one
+       var before = new Array[MMethodDef]
+
+       # Cases to execute after this one
+       var after = new Array[MMethodDef]
+
        redef fun full_name do return test_method.full_name
 
        redef fun location do return test_method.location
@@ -286,10 +288,14 @@ class TestCase
                if test_method.mproperty.is_toplevel then
                        file.addn "\t{name}"
                else
-                       file.addn "\tvar subject = new {test_method.mclassdef.name}.nitunit"
-                       file.addn "\tsubject.before_test"
+                       file.addn "\tvar subject = new {test_method.mclassdef.name}.intern"
+                       for mmethod in before do
+                               file.addn "\tsubject.{mmethod.name}"
+                       end
                        file.addn "\tsubject.{name}"
-                       file.addn "\tsubject.after_test"
+                       for mmethod in after do
+                               file.addn "\tsubject.{mmethod.name}"
+                       end
                end
                file.addn "end"
        end
@@ -374,54 +380,87 @@ class TestCase
        end
 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_")
+redef class MClassDef
+       # Methods tagged with `before` in this class definition
+       private fun before: Array[MMethodDef] do
+               var res = new Array[MMethodDef]
+               for mpropdef in mpropdefs do
+                       if mpropdef isa MMethodDef and mpropdef.is_before then
+                               res.add mpropdef
+                       end
+               end
+               var in_hierarchy = self.in_hierarchy
+               if in_hierarchy == null then return res
+               for mclassdef in in_hierarchy.direct_greaters do
+                       res.add_all mclassdef.before
+               end
+               return res
+       end
 
-       # Is the method a "before_module"?
-       private fun is_before_module: Bool do return name == "before_module"
+       # Methods tagged with `before_all` in this class definition
+       private fun before_all: Array[MMethodDef] do
+               var res = new Array[MMethodDef]
+               for mpropdef in mpropdefs do
+                       if mpropdef isa MMethodDef and mpropdef.is_before_all then
+                               res.add mpropdef
+                       end
+               end
+               var in_hierarchy = self.in_hierarchy
+               if in_hierarchy == null then return res
+               for mclassdef in in_hierarchy.direct_greaters do
+                       res.add_all mclassdef.before_all
+               end
+               return res
+       end
 
-       # Is the method a "after_module"?
-       private fun is_after_module: Bool do return name == "after_module"
-end
+       # Methods tagged with `after` in this class definition
+       private fun after: Array[MMethodDef] do
+               var res = new Array[MMethodDef]
+               for mpropdef in mpropdefs do
+                       if mpropdef isa MMethodDef and mpropdef.is_after then
+                               res.add mpropdef
+                       end
+               end
+               var in_hierarchy = self.in_hierarchy
+               if in_hierarchy == null then return res
+               for mclassdef in in_hierarchy.direct_greaters do
+                       res.add_all mclassdef.after
+               end
+               return res
+       end
 
-redef class MClassDef
-       # Is the class a TestClass?
-       # i.e. is a subclass of `TestSuite`
-       private fun is_test: Bool do
+       # Methods tagged with `after_all` in this class definition
+       private fun after_all: Array[MMethodDef] do
+               var res = new Array[MMethodDef]
+               for mpropdef in mpropdefs do
+                       if mpropdef isa MMethodDef and mpropdef.is_after_all then
+                               res.add mpropdef
+                       end
+               end
                var in_hierarchy = self.in_hierarchy
-               if in_hierarchy == null then return false
-               for sup in in_hierarchy.greaters do
-                       if sup.name == "TestSuite" then return true
+               if in_hierarchy == null then return res
+               for mclassdef in in_hierarchy.direct_greaters do
+                       res.add_all mclassdef.after_all
                end
-               return false
+               return res
        end
 end
 
 redef class MModule
-       # "before_module" method for this module.
-       private fun before_test: nullable MMethodDef do
+       # Methods tagged with `before_all` at the module level (in `Sys`)
+       private fun before_all: Array[MMethodDef] do
                for mclassdef in mclassdefs do
-                       if not mclassdef.name == "Sys" then continue
-                       for mpropdef in mclassdef.mpropdefs do
-                               if mpropdef isa MMethodDef and mpropdef.is_before_module then return mpropdef
-                       end
+                       if mclassdef.name == "Sys" then return mclassdef.before_all
                end
-               return null
+               return new Array[MMethodDef]
        end
 
-       # "after_module" method for this module.
-       private fun after_test: nullable MMethodDef do
+       # Methods tagged with `after_all` at the module level (in `Sys`)
+       private fun after_all: Array[MMethodDef] do
                for mclassdef in mclassdefs do
-                       if not mclassdef.name == "Sys" then continue
-                       for mpropdef in mclassdef.mpropdefs do
-                               if mpropdef isa MMethodDef and mpropdef.is_after_module then return mpropdef
-                       end
+                       if mclassdef.name == "Sys" then return mclassdef.after_all
                end
-               return null
+               return new Array[MMethodDef]
        end
 end
 
@@ -438,7 +477,7 @@ redef class ModelBuilder
        # Run NitUnit test suite for `mmodule` (if it is one).
        fun test_unit(mmodule: MModule): nullable HTMLTag do
                # is the module a test_suite?
-               if get_mmodule_annotation("test_suite", mmodule) == null then return null
+               if not mmodule.is_test then return null
                toolcontext.info("nitunit: test-suite {mmodule}", 2)
 
                var tester = new NitUnitTester(self)
index c863061..d50cc2a 100644 (file)
@@ -47,7 +47,7 @@ class NitwebConfig
                view.include_fictive = true
                view.include_empty_doc = true
                view.include_attribute = true
-               view.include_test_suite = true
+               view.include_test = true
                return view
        end
 end
index a71e35b..dcddc6a 100644 (file)
@@ -16,9 +16,9 @@
 ==== Test-suite of module test_test_nitunit::test_test_nitunit | tests: 3
 [OK] test_test_nitunit$TestX$test_foo
 [KO] test_test_nitunit$TestX$test_foo1
-     test_test_nitunit.nit:36,2--40,4: Runtime Error in file nitunit.out/gen_test_test_nitunit.nit
+     test_test_nitunit.nit:35,2--39,4: Runtime Error in file nitunit.out/gen_test_test_nitunit.nit
      Output
-       Runtime error: Assert failed (test_test_nitunit.nit:39)
+       Runtime error: Assert failed (test_test_nitunit.nit:38)
 
 [OK] test_test_nitunit$TestX$test_foo2
 
@@ -32,5 +32,5 @@ Test suites: Classes: 1; Test Cases: 3; Failures: 1
 </system-out></testcase><testcase classname="nitunit.test_nitunit.X" name="foo" time="0.0"><failure message="Compilation error in nitunit.out&#47;test_nitunit-3.nit">nitunit.out&#47;test_nitunit-3.nit:5,8--27: Error: method or variable `undefined_identifier` unknown in `Sys`.
 </failure><system-out>assert undefined_identifier
 </system-out></testcase><testcase classname="nitunit.test_nitunit.X" name="foo1" time="0.0"><failure message="Syntax Error: unexpected operator &#39;!&#39;."></failure><system-out>assert !@#$%^&amp;*()
-</system-out></testcase></testsuite><testsuite package="test_test_nitunit::test_test_nitunit"></testsuite><testsuite package="test_test_nitunit"><testcase classname="nitunit.test_test_nitunit.TestX" name="test_foo" time="0.0"><system-err></system-err></testcase><testcase classname="nitunit.test_test_nitunit.TestX" name="test_foo1" time="0.0"><error message="Runtime Error in file nitunit.out&#47;gen_test_test_nitunit.nit">Runtime error: Assert failed (test_test_nitunit.nit:39)
+</system-out></testcase></testsuite><testsuite package="test_test_nitunit::test_test_nitunit"></testsuite><testsuite package="test_test_nitunit"><testcase classname="nitunit.test_test_nitunit.TestX" name="test_foo" time="0.0"><system-err></system-err></testcase><testcase classname="nitunit.test_test_nitunit.TestX" name="test_foo1" time="0.0"><error message="Runtime Error in file nitunit.out&#47;gen_test_test_nitunit.nit">Runtime error: Assert failed (test_test_nitunit.nit:38)
 </error></testcase><testcase classname="nitunit.test_test_nitunit.TestX" name="test_foo2" time="0.0"><system-err></system-err></testcase></testsuite></testsuites>
\ No newline at end of file
index 0a8b785..42ee33e 100644 (file)
@@ -1,13 +1,13 @@
 ==== Test-suite of module test_nitunit6::test_nitunit6 | tests: 3
 [KO] test_nitunit6::test_nitunit6$core::Sys$before_module
-     test_nitunit6.nit:27,1--29,3: Runtime Error in file nitunit.out/gen_test_nitunit6.nit
+     test_nitunit6.nit:25,1--27,3: Runtime Error in file nitunit.out/gen_test_nitunit6.nit
      Output
-       Runtime error: Assert failed (test_nitunit6.nit:28)
+       Runtime error: Assert failed (test_nitunit6.nit:26)
 
 [KO] test_nitunit6$TestNitunit6$test_foo
-     test_nitunit6.nit:22,2--24,4: Nitunit Error: before_module test failed
+     test_nitunit6.nit:20,2--22,4: Nitunit Error: before_module test failed
 [KO] test_nitunit6::test_nitunit6$core::Sys$after_module
-     test_nitunit6.nit:31,1--33,3: Nitunit Error: before_module test failed
+     test_nitunit6.nit:29,1--31,3: Nitunit Error: before_module test failed
 
 Docunits: Entities: 5; Documented ones: 0; With nitunits: 0
 Test suites: Classes: 1; Test Cases: 3; Failures: 3
index aa79730..9015b4a 100644 (file)
@@ -2,9 +2,9 @@
 [OK] test_nitunit7::test_nitunit7$core::Sys$before_module
 [OK] test_nitunit7$TestNitunit7$test_foo
 [KO] test_nitunit7::test_nitunit7$core::Sys$after_module
-     test_nitunit7.nit:31,1--33,3: Runtime Error in file nitunit.out/gen_test_nitunit7.nit
+     test_nitunit7.nit:29,1--31,3: Runtime Error in file nitunit.out/gen_test_nitunit7.nit
      Output
-       Runtime error: Assert failed (test_nitunit7.nit:32)
+       Runtime error: Assert failed (test_nitunit7.nit:30)
 
 
 Docunits: Entities: 5; Documented ones: 0; With nitunits: 0
index bc00752..06ef822 100644 (file)
@@ -1,19 +1,18 @@
-module test_test_nitunit is test_suite
+module test_test_nitunit is test
 
-import test_suite
 import test_nitunit
 
 class TestX
-       super TestSuite
+       test
 
-       fun test_foo do
+       fun test_foo is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: X
                subject.foo
        end
 
-       fun test_foo1 do
+       fun test_foo1 is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: X
@@ -22,7 +21,7 @@ class TestX
                subject.foo1(a, b)
        end
 
-       fun test_foo3 do
+       fun test_foo3 is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: X
@@ -33,9 +32,9 @@ class TestX
 end
 
 class TestY
-       super TestSuite
+       test
 
-       fun test_bra do
+       fun test_bra is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -45,7 +44,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_bra_assign do
+       fun test_bra_assign is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -54,7 +53,7 @@ class TestY
                subject[e] = i
        end
 
-       fun test_plus do
+       fun test_plus is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -64,7 +63,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_minus do
+       fun test_minus is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -74,7 +73,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_star do
+       fun test_star is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -84,7 +83,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_slash do
+       fun test_slash is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -94,7 +93,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_percent do
+       fun test_percent is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -104,7 +103,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_unary_minus do
+       fun test_unary_minus is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -113,7 +112,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_equals do
+       fun test_equals is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -123,7 +122,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_not_equals do
+       fun test_not_equals is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -133,7 +132,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_lt do
+       fun test_lt is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -143,7 +142,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_le do
+       fun test_le is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -153,7 +152,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_compare do
+       fun test_compare is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -163,7 +162,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_ge do
+       fun test_ge is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -173,7 +172,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_gt do
+       fun test_gt is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -185,9 +184,9 @@ class TestY
 end
 
 class TestZ
-       super TestSuite
+       test
 
-       fun test_bra do
+       fun test_bra is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Z
@@ -198,7 +197,7 @@ class TestZ
                assert exp == res
        end
 
-       fun test_bra_assign do
+       fun test_bra_assign is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Z
@@ -208,7 +207,7 @@ class TestZ
                subject[i, j] = k
        end
 
-       fun test_foo= do
+       fun test_foo= is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Z
@@ -217,7 +216,7 @@ class TestZ
                subject.foo(i) = j
        end
 
-       fun test_bar= do
+       fun test_bar= is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Z
index e93c6ca..586af7d 100644 (file)
@@ -1,19 +1,18 @@
-module test_test_nitunit is test_suite
+module test_test_nitunit is test
 
-import test_suite
 intrude import test_nitunit
 
 class TestX
-       super TestSuite
+       test
 
-       fun test_foo do
+       fun test_foo is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: X
                subject.foo
        end
 
-       fun test_foo1 do
+       fun test_foo1 is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: X
@@ -22,7 +21,7 @@ class TestX
                subject.foo1(a, b)
        end
 
-       fun test_foo2 do
+       fun test_foo2 is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: X
@@ -31,7 +30,7 @@ class TestX
                assert exp == res
        end
 
-       fun test_foo3 do
+       fun test_foo3 is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: X
@@ -40,7 +39,7 @@ class TestX
                assert exp == res
        end
 
-       fun test_foo3= do
+       fun test_foo3= is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: X
@@ -50,9 +49,9 @@ class TestX
 end
 
 class TestY
-       super TestSuite
+       test
 
-       fun test_bra do
+       fun test_bra is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -62,7 +61,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_bra_assign do
+       fun test_bra_assign is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -71,7 +70,7 @@ class TestY
                subject[e] = i
        end
 
-       fun test_plus do
+       fun test_plus is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -81,7 +80,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_minus do
+       fun test_minus is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -91,7 +90,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_star do
+       fun test_star is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -101,7 +100,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_slash do
+       fun test_slash is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -111,7 +110,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_percent do
+       fun test_percent is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -121,7 +120,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_unary_minus do
+       fun test_unary_minus is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -130,7 +129,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_equals do
+       fun test_equals is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -140,7 +139,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_not_equals do
+       fun test_not_equals is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -150,7 +149,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_lt do
+       fun test_lt is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -160,7 +159,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_le do
+       fun test_le is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -170,7 +169,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_compare do
+       fun test_compare is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -180,7 +179,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_ge do
+       fun test_ge is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -190,7 +189,7 @@ class TestY
                assert exp == res
        end
 
-       fun test_gt do
+       fun test_gt is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Y[X]
@@ -202,9 +201,9 @@ class TestY
 end
 
 class TestZ
-       super TestSuite
+       test
 
-       fun test_bra do
+       fun test_bra is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Z
@@ -215,7 +214,7 @@ class TestZ
                assert exp == res
        end
 
-       fun test_bra_assign do
+       fun test_bra_assign is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Z
@@ -225,7 +224,7 @@ class TestZ
                subject[i, j] = k
        end
 
-       fun test_foo= do
+       fun test_foo= is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Z
@@ -234,7 +233,7 @@ class TestZ
                subject.foo(i) = j
        end
 
-       fun test_bar= do
+       fun test_bar= is test do
                assert not_implemented: false # TODO remove once implemented
 
                var subject: Z
index bb114f6..18de7be 100644 (file)
@@ -1,41 +1,41 @@
-test_nitunit4/test_bad_comp.nit:27,10--19: Error: method or variable `bad_method` unknown in `TestSuiteBadComp`.
-test_nitunit4/test_bad_comp2.nit:19,7--22: Error: a class named `test_nitunit4::TestSuiteBadComp` is already defined in module `test_bad_comp` at test_nitunit4/test_bad_comp.nit:19,1--29,3.
+test_nitunit4/test_bad_comp.nit:25,10--19: Error: method or variable `bad_method` unknown in `TestSuiteBadComp`.
+test_nitunit4/test_bad_comp2.nit:17,7--22: Error: a class named `test_nitunit4::TestSuiteBadComp` is already defined in module `test_bad_comp` at test_nitunit4/test_bad_comp.nit:17,1--27,3.
 ==== Test-suite of module test_nitunit4::test_bad_comp | tests: 2
 [KO] test_nitunit4$TestSuiteBadComp$test_good
-     test_nitunit4/test_bad_comp.nit:22,2--24,4: Compilation Error
+     test_nitunit4/test_bad_comp.nit:20,2--22,4: Compilation Error
      Output
-       test_nitunit4/test_bad_comp.nit:27,10--19: Error: method or variable `bad_method` unknown in `TestSuiteBadComp`.
+       test_nitunit4/test_bad_comp.nit:25,10--19: Error: method or variable `bad_method` unknown in `TestSuiteBadComp`.
 
 [KO] test_nitunit4$TestSuiteBadComp$test_bad
-     test_nitunit4/test_bad_comp.nit:26,2--28,4: Compilation Error
+     test_nitunit4/test_bad_comp.nit:24,2--26,4: Compilation Error
      Output
-       test_nitunit4/test_bad_comp.nit:27,10--19: Error: method or variable `bad_method` unknown in `TestSuiteBadComp`.
+       test_nitunit4/test_bad_comp.nit:25,10--19: Error: method or variable `bad_method` unknown in `TestSuiteBadComp`.
 
 
 ==== Test-suite of module test_nitunit4::test_bad_comp2 | tests: 2
 [KO] test_nitunit4$TestSuiteBadComp$test_good
-     test_nitunit4/test_bad_comp2.nit:22,2--24,4: Compilation Error
+     test_nitunit4/test_bad_comp2.nit:20,2--22,4: Compilation Error
      Output
-       nitunit.out/gen_test_bad_comp2.nit:14,10--17: Error: expected 1 argument(s) for `test_bad(param: Bool)`; got 0. See introduction at `test_nitunit4::TestSuiteBadComp::test_bad`.
+       nitunit.out/gen_test_bad_comp2.nit:11,10--17: Error: expected 1 argument(s) for `test_bad(param: Bool)`; got 0. See introduction at `test_nitunit4::TestSuiteBadComp::test_bad`.
 
 [KO] test_nitunit4$TestSuiteBadComp$test_bad
-     test_nitunit4/test_bad_comp2.nit:26,2--28,4: Compilation Error
+     test_nitunit4/test_bad_comp2.nit:24,2--26,4: Compilation Error
      Output
-       nitunit.out/gen_test_bad_comp2.nit:14,10--17: Error: expected 1 argument(s) for `test_bad(param: Bool)`; got 0. See introduction at `test_nitunit4::TestSuiteBadComp::test_bad`.
+       nitunit.out/gen_test_bad_comp2.nit:11,10--17: Error: expected 1 argument(s) for `test_bad(param: Bool)`; got 0. See introduction at `test_nitunit4::TestSuiteBadComp::test_bad`.
 
 
 ==== Test-suite of module test_nitunit4::test_nitunit4 | tests: 4
 [KO] test_nitunit4$TestTestSuite$test_foo
-     test_nitunit4/test_nitunit4.nit:22,2--26,4: Runtime Error in file nitunit.out/gen_test_nitunit4.nit
+     test_nitunit4/test_nitunit4.nit:23,2--27,4: Runtime Error in file nitunit.out/gen_test_nitunit4.nit
      Output
        Before Test
        Tested method
        After Test
-       Runtime error: Assert failed (test_nitunit4/test_nitunit4_base.nit:31)
+       Runtime error: Assert failed (test_nitunit4/test_nitunit4_base.nit:28)
 
 [OK] test_nitunit4$TestTestSuite$test_bar
 [KO] test_nitunit4$TestTestSuite$test_baz
-     test_nitunit4/test_nitunit4.nit:32,2--34,4: Difference with expected output: diff -u test_nitunit4/test_baz.res nitunit.out/gen_test_nitunit4_test_baz.out1
+     test_nitunit4/test_nitunit4.nit:33,2--35,4: Difference with expected output: diff -u test_nitunit4/test_baz.res nitunit.out/gen_test_nitunit4_test_baz.out1
      Output
        Diff
        --- expected:test_nitunit4/test_baz.res
@@ -47,28 +47,25 @@ test_nitunit4/test_bad_comp2.nit:19,7--22: Error: a class named `test_nitunit4::
        +After Test
 
 [KO] test_nitunit4$TestTestSuite$test_sav_conflict
-     test_nitunit4/test_nitunit4.nit:36,2--38,4: Conflicting expected output: test_nitunit4/test_nitunit4.sav/test_sav_conflict.res, test_nitunit4/sav/test_sav_conflict.res and test_nitunit4/test_sav_conflict.res all exist
+     test_nitunit4/test_nitunit4.nit:37,2--39,4: Conflicting expected output: test_nitunit4/test_nitunit4.sav/test_sav_conflict.res, test_nitunit4/sav/test_sav_conflict.res and test_nitunit4/test_sav_conflict.res all exist
      Output
        Before Test
        Tested method
        After Test
 
 
-==== Test-suite of module test_nitunit4::test_nitunit4_base | tests: 0
-==== Test-suite of module test_nitunit4::test_nitunit4_base | tests: 0
-
 Docunits: Entities: 21; Documented ones: 0; With nitunits: 0
-Test suites: Classes: 4; Test Cases: 8; Failures: 7
+Test suites: Classes: 3; Test Cases: 8; Failures: 7
 [FAILURE] 7/8 tests failed.
 `nitunit.out` is not removed for investigation.
-<testsuites><testsuite package="test_nitunit4&gt;"></testsuite><testsuite package="test_nitunit4::nitunit4"></testsuite><testsuite package="test_nitunit4::test_bad_comp"></testsuite><testsuite package="test_bad_comp"><testcase classname="nitunit.test_nitunit4.TestSuiteBadComp" name="test_good" time="0.0"><failure message="Compilation Error">test_nitunit4&#47;test_bad_comp.nit:27,10--19: Error: method or variable `bad_method` unknown in `TestSuiteBadComp`.
-</failure></testcase><testcase classname="nitunit.test_nitunit4.TestSuiteBadComp" name="test_bad" time="0.0"><failure message="Compilation Error">test_nitunit4&#47;test_bad_comp.nit:27,10--19: Error: method or variable `bad_method` unknown in `TestSuiteBadComp`.
-</failure></testcase></testsuite><testsuite package="test_nitunit4::test_bad_comp2"></testsuite><testsuite package="test_bad_comp2"><testcase classname="nitunit.test_nitunit4.TestSuiteBadComp" name="test_good" time="0.0"><failure message="Compilation Error">nitunit.out&#47;gen_test_bad_comp2.nit:14,10--17: Error: expected 1 argument(s) for `test_bad(param: Bool)`; got 0. See introduction at `test_nitunit4::TestSuiteBadComp::test_bad`.
-</failure></testcase><testcase classname="nitunit.test_nitunit4.TestSuiteBadComp" name="test_bad" time="0.0"><failure message="Compilation Error">nitunit.out&#47;gen_test_bad_comp2.nit:14,10--17: Error: expected 1 argument(s) for `test_bad(param: Bool)`; got 0. See introduction at `test_nitunit4::TestSuiteBadComp::test_bad`.
+<testsuites><testsuite package="test_nitunit4&gt;"></testsuite><testsuite package="test_nitunit4::nitunit4"></testsuite><testsuite package="test_nitunit4::test_bad_comp"></testsuite><testsuite package="test_bad_comp"><testcase classname="nitunit.test_nitunit4.TestSuiteBadComp" name="test_good" time="0.0"><failure message="Compilation Error">test_nitunit4&#47;test_bad_comp.nit:25,10--19: Error: method or variable `bad_method` unknown in `TestSuiteBadComp`.
+</failure></testcase><testcase classname="nitunit.test_nitunit4.TestSuiteBadComp" name="test_bad" time="0.0"><failure message="Compilation Error">test_nitunit4&#47;test_bad_comp.nit:25,10--19: Error: method or variable `bad_method` unknown in `TestSuiteBadComp`.
+</failure></testcase></testsuite><testsuite package="test_nitunit4::test_bad_comp2"></testsuite><testsuite package="test_bad_comp2"><testcase classname="nitunit.test_nitunit4.TestSuiteBadComp" name="test_good" time="0.0"><failure message="Compilation Error">nitunit.out&#47;gen_test_bad_comp2.nit:11,10--17: Error: expected 1 argument(s) for `test_bad(param: Bool)`; got 0. See introduction at `test_nitunit4::TestSuiteBadComp::test_bad`.
+</failure></testcase><testcase classname="nitunit.test_nitunit4.TestSuiteBadComp" name="test_bad" time="0.0"><failure message="Compilation Error">nitunit.out&#47;gen_test_bad_comp2.nit:11,10--17: Error: expected 1 argument(s) for `test_bad(param: Bool)`; got 0. See introduction at `test_nitunit4::TestSuiteBadComp::test_bad`.
 </failure></testcase></testsuite><testsuite package="test_nitunit4::test_nitunit4"></testsuite><testsuite package="test_nitunit4"><testcase classname="nitunit.test_nitunit4.TestTestSuite" name="test_foo" time="0.0"><error message="Runtime Error in file nitunit.out&#47;gen_test_nitunit4.nit">Before Test
 Tested method
 After Test
-Runtime error: Assert failed (test_nitunit4&#47;test_nitunit4_base.nit:31)
+Runtime error: Assert failed (test_nitunit4&#47;test_nitunit4_base.nit:28)
 </error></testcase><testcase classname="nitunit.test_nitunit4.TestTestSuite" name="test_bar" time="0.0"><system-err>Before Test
 Tested method
 After Test
@@ -83,4 +80,4 @@ After Test
 </error></testcase><testcase classname="nitunit.test_nitunit4.TestTestSuite" name="test_sav_conflict" time="0.0"><error message="Conflicting expected output: test_nitunit4&#47;test_nitunit4.sav&#47;test_sav_conflict.res, test_nitunit4&#47;sav&#47;test_sav_conflict.res and test_nitunit4&#47;test_sav_conflict.res all exist">Before Test
 Tested method
 After Test
-</error></testcase></testsuite><testsuite package="test_nitunit4::test_nitunit4_base"></testsuite><testsuite package="test_nitunit4_base"></testsuite></testsuites>
\ No newline at end of file
+</error></testcase></testsuite><testsuite package="test_nitunit4::test_nitunit4_base"></testsuite></testsuites>
\ No newline at end of file
index 26fb54f..52e9594 100644 (file)
@@ -1,10 +1,8 @@
 syntax_annotations3.nit:16,2--20: Warning: unknown annotation `invariant`.
 syntax_annotations3.nit:19,3--12: Warning: unknown annotation `pre`.
 syntax_annotations3.nit:20,3--22: Warning: unknown annotation `post`.
-syntax_annotations3.nit:21,3--19: Warning: unknown annotation `test`.
 syntax_annotations3.nit:28,3--7: Warning: unknown annotation `inter`.
 syntax_annotations3.nit:33,16--18: Warning: unknown annotation `u32`.
-syntax_annotations3.nit:34,19--36: Warning: unknown annotation `after`.
 syntax_annotations3.nit:34,12--36: Warning: unknown annotation `daemon`.
 syntax_annotations3.nit:34,3--37: Warning: unknown annotation `ondebug`.
 syntax_annotations3.nit:35,3--7: Warning: unknown annotation `final`.
index f8d9b87..04354d0 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_bad_comp is test_suite
-
-import test_suite
+module test_bad_comp is test
 
 class TestSuiteBadComp
-       super TestSuite
+       test
 
-       fun test_good do
+       fun test_good is test do
                assert true
        end
 
-       fun test_bad do
+       fun test_bad is test do
                assert bad_method
        end
 end
index aac1a09..c274df6 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_bad_comp2 is test_suite
-
-import test_suite
+module test_bad_comp2 is test
 
 class TestSuiteBadComp
-       super TestSuite
+       test
 
-       fun test_good do
+       fun test_good is test do
                assert true
        end
 
-       fun test_bad(param: Bool) do
+       fun test_bad(param: Bool) is test do
                assert param
        end
 end
index 8864263..dfb5e32 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_nitunit4 is test_suite
+module test_nitunit4 is test
 
 import test_nitunit4_base
 
 class TestTestSuite
        super SuperTestSuite
+       test
 
-       fun test_foo do
+       fun test_foo is test do
                print "Tested method"
                assert before
                before = false
        end
 
-       fun test_bar do
+       fun test_bar is test do
                print "Tested method"
        end
 
-       fun test_baz do
+       fun test_baz is test do
                print "Tested method"
        end
 
-       fun test_sav_conflict do
+       fun test_sav_conflict is test do
                print "Tested method"
        end
 end
index af21e73..3fe9e16 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_nitunit4_base is test_suite
-
-import test_suite
+module test_nitunit4_base
 
 class SuperTestSuite
-       super TestSuite
 
        var before = false
 
-       redef fun before_test do
+       fun before_test is before do
                print "Before Test"
                before = true
        end
 
-       redef fun after_test do
+       fun after_test is after do
                print "After Test"
                assert before
        end
index 602648b..fc327aa 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_nitunit5 is test_suite
-
-import test_suite
+module test_nitunit5 is test
 
 class TestNitunit5
-       super TestSuite
+       test
 
-       fun test_path_is_set do
+       fun test_path_is_set is test do
                assert "NIT_TESTING_PATH".environ != ""
        end
 
-       fun test_path_is_suite_path do
+       fun test_path_is_suite_path is test do
                assert "NIT_TESTING_PATH".environ.basename == "test_nitunit5.nit"
        end
 end
index 97eca0a..f5f4e67 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_nitunit6 is test_suite
-
-import test_suite
+module test_nitunit6 is test
 
 class TestNitunit6
-       super TestSuite
+       test
 
-       fun test_foo do
+       fun test_foo is test do
                assert true
        end
 end
 
-redef fun before_module do
+fun before_module is before_all do
        assert false
 end
 
-redef fun after_module do
+fun after_module is after_all do
        assert false
 end
index 63f47ea..3c79772 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-module test_nitunit7 is test_suite
-
-import test_suite
+module test_nitunit7 is test
 
 class TestNitunit7
-       super TestSuite
+       test
 
-       fun test_foo do
+       fun test_foo is test do
                assert true
        end
 end
 
-redef fun before_module do
+fun before_module is before_all do
        assert true
 end
 
-redef fun after_module do
+fun after_module is after_all do
        assert false
 end
index 71ce971..b04e567 100644 (file)
 # limitations under the License.
 
 # NitUnit file for test_nitunit module.
-module test_test_nitunit is test_suite
+module test_test_nitunit is test
 
-import test_suite
 intrude import test_nitunit
 
 class TestX
-       super TestSuite
+       test
 
        var subject: X is noinit
 
-       redef fun before_test do
+       fun before_test is before do
                subject = new X
        end
 
-       fun test_foo do
+       fun test_foo is test do
                subject.foo
        end
 
        # will fail
-       fun test_foo1 do
+       fun test_foo1 is test do
                subject.foo1(10, 20)
                assert false
        end
 
-       fun test_foo2 do
+       fun test_foo2 is test do
                assert subject.foo2
        end
 end