Forráskód Böngészése

ASSER accepts only one argument (as in a new report 07/13)

Vladislav Folts 11 éve
szülő
commit
4d1369e1ae
4 módosított fájl, 5 hozzáadás és 10 törlés
  1. 2 5
      src/procedure.js
  2. 0 1
      test/expected/assert.js
  3. 0 1
      test/input/assert.ob
  4. 3 3
      test/test_unit.js

+ 2 - 5
src/procedure.js

@@ -382,13 +382,10 @@ exports.predefined = [
             init: function AssertProcCallGenerator(context, id, type){
                 ProcCallGenerator.prototype.init.call(this, context, id, type);
             },
-            prolog: function(){return this.context().rtl().assertId() + "(";},
-            checkArgumentsCount: function(count){
-                checkVariableArgumentsCount(1, 2, count);
-            }
+            prolog: function(){return this.context().rtl().assertId() + "(";}
         });
 
-        var args = [new Arg(Type.basic.bool), new Arg(Type.basic.integer)];
+        var args = [new Arg(Type.basic.bool)];
         var proc = new Std(
             "ASSERT",
             args,

+ 0 - 1
test/expected/assert.js

@@ -7,5 +7,4 @@ var RTL$ = {
 };
 var m = function (){
 RTL$.assert(true);
-RTL$.assert(true, 123);
 }();

+ 0 - 1
test/input/assert.ob

@@ -2,5 +2,4 @@ MODULE m;
 
 BEGIN
     ASSERT(TRUE);
-    ASSERT(TRUE, 123)
 END m.

+ 3 - 3
test/test_unit.js

@@ -1253,9 +1253,9 @@ var testSuite = {
     ),
 "assert": testWithGrammar(
     Grammar.statement,
-    pass("ASSERT(TRUE)",
-         "ASSERT(TRUE, 123)"),
-    fail(["ASSERT()", "at least 1 argument expected, got 0"],
+    pass("ASSERT(TRUE)"),
+    fail(["ASSERT()", "1 argument(s) expected, got 0"],
+         ["ASSERT(TRUE, 123)", "1 argument(s) expected, got 2"],
          ["ASSERT(123, TRUE)", "type mismatch for argument 1: 'INTEGER' cannot be converted to 'BOOLEAN'"])
     ),
 "export": testWithGrammar(