diff --git a/box.json b/box.json index 2298b64f1..eeb10488e 100644 --- a/box.json +++ b/box.json @@ -52,7 +52,7 @@ }, "devDependencies":{ - "testbox":"2.3.0" + "testbox":"2.5.0" }, "installPaths":{ "testbox":"tests/testbox" diff --git a/tests/run.cfm b/tests/run.cfm index ce399a55d..becfd23c1 100644 --- a/tests/run.cfm +++ b/tests/run.cfm @@ -1,24 +1,36 @@ - - function exitCode( required numeric code ) { - var exitcodeFile = GetDirectoryFromPath( GetCurrentTemplatePath() ) & "/.exitcode"; - FileWrite( exitcodeFile, code ); - if (code == 1) { - cfheader(statuscode="500",statustext="Tests Failed"); - } - } - try { - reporter = cgi.server_protocol == "CLI/1.0" ? "text" : "simple"; - testbox = new testbox.system.TestBox( options={}, reporter=reporter, directory={ - recurse = true - , mapping = "tests" - , filter = function( required path ){ return true; } - } ); - writeOutput( testbox.run() ); - resultObject = testbox.getResult(); - errors = resultObject.getTotalFail() + resultObject.getTotalError(); - exitCode( errors ? 1 : 0 ); - } catch ( any e ) { - writeOutput( "An error occurred running the tests. Message: [#e.message#], Detail: [#e.detail#]" ); - exitCode( 1 ); - } - \ No newline at end of file + + + + + + + +Test Environment: + + Adobe ColdFusion #server.coldfusion.productversion# + + Lucee #server.lucee.version# + + Railo #server.railo.version# + + #server.coldfusion.productname# + + on #server.os.name# #server.os.version# + + running Java #system.getProperty("java.version")# + + + + +#r.run()# + + + + + + + + + ReRun + + \ No newline at end of file diff --git a/tests/tests/TestExamples.cfc b/tests/tests/TestExamples.cfc index 2210b9b3b..b8ff3c157 100644 --- a/tests/tests/TestExamples.cfc +++ b/tests/tests/TestExamples.cfc @@ -49,7 +49,13 @@ component extends="testbox.system.BaseSpec" { expect(actualResult).toBeFalse("#fileName# example result is:#e.result# but evaluated to:#actualResult#"); } } else { - expect(actualResult).toBe(e.result, "#fileName# example result is:#e.result# but evaluated to:#actualResult#"); + if (isNumeric(e.result) && len(e.result) > 10) { + //there are some rounding differences to account for between ACF and Lucee, see results of acos(0.3) for example + expect(numberFormat(actualResult, "_.________")).toBe(numberFormat(e.result, "_.________"), "#fileName# example result is:#e.result# but evaluated to:#actualResult#"); + } else { + expect(actualResult).toBe(e.result, "#fileName# example result is:#e.result# but evaluated to:#actualResult#"); + } + } }