for mclassdef in in_hierarchy.direct_greaters do
res.add_all mclassdef.before
end
- return res.to_a
+ var lin = res.to_a
+ mmodule.linearize_mpropdefs(lin)
+ return lin
end
# Methods tagged with `before_all` in this class definition
for mclassdef in in_hierarchy.direct_greaters do
res.add_all mclassdef.before_all
end
- return res.to_a
+ var lin = res.to_a
+ mmodule.linearize_mpropdefs(lin)
+ return lin
end
# Methods tagged with `after` in this class definition
for mclassdef in in_hierarchy.direct_greaters do
res.add_all mclassdef.after
end
- return res.to_a
+ var lin = res.to_a
+ mmodule.linearize_mpropdefs(lin)
+ return lin.reversed
end
# Methods tagged with `after_all` in this class definition
for mclassdef in in_hierarchy.direct_greaters do
res.add_all mclassdef.after_all
end
- return res.to_a
+ var lin = res.to_a
+ mmodule.linearize_mpropdefs(lin)
+ return lin.reversed
end
end
end
end
end
- return res
+ var lin = res.to_a
+ linearize_mpropdefs(lin)
+ return lin
end
# Methods tagged with `after_all` at the module level (in `Sys`)
end
end
end
- return res
+ var lin = res.to_a
+ linearize_mpropdefs(lin)
+ return lin.reversed
end
end
test_nitunit6.nit --no-color -o $WRITE
test_nitunit7.nit --no-color -o $WRITE
test_nitunit8.nit --no-color -o $WRITE
+test_nitunit11.nit --no-color -o $WRITE
--- /dev/null
+==== Test-suite of module test_nitunit11::test_nitunit11 | tests: 7
+[OK] test_nitunit9$TestNitunit9$before_class
+[OK] test_nitunit10$TestNitunit10$before_class2
+[OK] test_nitunit11$TestNitunit11$before_class3
+[OK] test_nitunit11$TestNitunit11$test_baz
+[OK] test_nitunit11$TestNitunit11$after_class3
+[OK] test_nitunit10$TestNitunit10$after_class2
+[KO] test_nitunit9$TestNitunit9$after_class
+ test_nitunit9.nit:36,2--38,4: Runtime Error in file nitunit.out/gen_test_nitunit11.nit
+ Output
+ Runtime error: Assert failed (test_nitunit9.nit:37)
+
+
+Docunits: Entities: 7; Documented ones: 0; With nitunits: 0
+Test suites: Classes: 1; Test Cases: 7; Failures: 1
+[FAILURE] 1/7 tests failed.
+`nitunit.out` is not removed for investigation.
+<testsuites><testsuite package="test_nitunit11::test_nitunit11"></testsuite><testsuite package="test_nitunit11"><testcase classname="nitunit.test_nitunit11.TestNitunit11" name="test_baz" time="0.0"><system-err></system-err></testcase></testsuite></testsuites>
\ No newline at end of file
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+module test_nitunit10 is test
+
+import test_nitunit9
+
+class TestNitunit10
+ super TestNitunit9
+ test
+
+ fun before_class2 is before_all do
+ assert true
+ end
+
+ fun before2 is before do
+ assert true
+ end
+
+ fun test_bar is test do
+ assert true
+ end
+
+ fun after2 is after do
+ assert true
+ end
+
+ fun after_class2 is after_all do
+ assert true
+ end
+end
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+module test_nitunit11 is test
+
+import test_nitunit10
+
+class TestNitunit11
+ super TestNitunit10
+ test
+
+ fun before_class3 is before_all do
+ assert true
+ end
+
+ fun before3 is before do
+ assert true
+ end
+
+ fun test_baz is test do
+ assert true
+ end
+
+ fun after3 is after do
+ assert true
+ end
+
+ fun after_class3 is after_all do
+ assert true
+ end
+end
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+module test_nitunit9 is test
+
+class TestNitunit9
+ test
+
+ fun before_class is before_all do
+ assert true
+ end
+
+ fun before is before do
+ assert true
+ end
+
+ fun test_foo is test do
+ assert true
+ end
+
+ fun after is after do
+ assert true
+ end
+
+ fun after_class is after_all do
+ assert false
+ end
+end