X-Git-Url: http://nitlanguage.org diff --git a/src/testing/testing_doc.nit b/src/testing/testing_doc.nit index 2bdbb02..d6de328 100644 --- a/src/testing/testing_doc.nit +++ b/src/testing/testing_doc.nit @@ -144,7 +144,7 @@ class NitUnitExecutor var dir = file.dirname if dir != "" then dir.mkdir var f - f = new OFStream.open(file) + f = new FileWriter.open(file) f.write("# GENERATED FILE\n") f.write("# Docunits extracted from comments\n") f.write("import {mmodule.name}\n") @@ -159,7 +159,7 @@ class NitUnitExecutor f.write("end\n") end f.write("var a = args.first.to_i\n") - for j in [1..i[ do + for j in [1..i] do f.write("if a == {j} then run_{j}\n") end f.close @@ -193,7 +193,7 @@ class NitUnitExecutor var res2 = sys.system("{file.to_program_name}.bin {i} >>'{file}.out1' 2>&1 ` XML element that contains the results of the executions. fun test_markdown(mmodule: MModule): HTMLTag do var ts = new HTMLTag("testsuite") toolcontext.info("nitunit: doc-unit {mmodule}", 2) - if not mmodule2nmodule.has_key(mmodule) then return ts - var nmodule = mmodule2nmodule[mmodule] + var nmodule = mmodule2node(mmodule) + if nmodule == null then return ts # usualy, only the original module must be imported in the unit test. var o = mmodule