test_unit_eberon.js 564 B

1234567891011121314151617181920
  1. "use strict";
  2. var grammar = require("eberon/eberon_grammar.js").grammar;
  3. var TestUnitCommon = require("test_unit_common.js");
  4. var pass = TestUnitCommon.pass;
  5. var fail = TestUnitCommon.fail;
  6. var context = TestUnitCommon.context;
  7. function testWithContext(context, pass, fail){
  8. return TestUnitCommon.testWithContext(context, grammar.declarationSequence, pass, fail);
  9. }
  10. exports.suite = {
  11. "new method declaration": testWithContext(
  12. context(grammar.declarationSequence, "TYPE T = RECORD END;"),
  13. pass("PROCEDURE T.p(), NEW; END T.p;"),
  14. fail()
  15. )
  16. };