@@ -213,7 +213,7 @@ public void stringConcatenation() throws IOException {
213213 }
214214
215215 @ Test
216- public void numericOpsAreGuardedWithEnsure () throws IOException {
216+ public void numericOpsDoNotUseGlobalEnsureWrapping () throws IOException {
217217 test ().testLua (true ).lines (
218218 "package Test" ,
219219 "function cmp(int a, int b) returns boolean" ,
@@ -227,10 +227,13 @@ public void numericOpsAreGuardedWithEnsure() throws IOException {
227227 " divi(2, 1)" ,
228228 " addi(1, 2)"
229229 );
230- String compiled = Files .toString (new File ("test-output/lua/LuaTranslationTests_numericOpsAreGuardedWithEnsure.lua" ), Charsets .UTF_8 );
231- assertFunctionBodyContains (compiled , "cmp" , "intEnsure" , true );
232- assertFunctionBodyContains (compiled , "divi" , "intEnsure" , true );
233- assertTrue (compiled .contains ("function addi" ) && (compiled .contains ("realEnsure(a2)" ) || compiled .contains ("intEnsure(a2)" )));
230+ String compiled = Files .toString (new File ("test-output/lua/LuaTranslationTests_numericOpsDoNotUseGlobalEnsureWrapping.lua" ), Charsets .UTF_8 );
231+ assertFunctionBodyContains (compiled , "cmp" , "intEnsure" , false );
232+ assertFunctionBodyContains (compiled , "cmp" , "realEnsure" , false );
233+ assertFunctionBodyContains (compiled , "divi" , "intEnsure" , false );
234+ assertFunctionBodyContains (compiled , "divi" , "realEnsure" , false );
235+ assertFunctionBodyContains (compiled , "addi" , "intEnsure" , false );
236+ assertFunctionBodyContains (compiled , "addi" , "realEnsure" , false );
234237 }
235238
236239 @ Test
0 commit comments