Bladeren bron

Test for pragma in block.

Herby Vojčík 6 jaren geleden
bovenliggende
commit
2c60b3a417
2 gewijzigde bestanden met toevoegingen van 28 en 0 verwijderingen
  1. 24 0
      src/Compiler-Tests.js
  2. 4 0
      src/Compiler-Tests.st

+ 24 - 0
src/Compiler-Tests.js

@@ -1319,6 +1319,30 @@ messageSends: ["should:return:", "at:", "globals"]
 }),
 $globals.CodeGeneratorTest);
 
+$core.addMethod(
+$core.method({
+selector: "testPragmaInBlock",
+protocol: "tests",
+fn: function (){
+var self=this,$self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$self._should_receiver_raise_("foo ^ [ < fooBar > 4 ] value",$self["@receiver"],$globals.Error);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"testPragmaInBlock",{},$globals.CodeGeneratorTest)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "testPragmaInBlock\x0a\x09self should: 'foo ^ [ < fooBar > 4 ] value' receiver: receiver raise: Error",
+referencedClasses: ["Error"],
+//>>excludeEnd("ide");
+messageSends: ["should:receiver:raise:"]
+}),
+$globals.CodeGeneratorTest);
+
 $core.addMethod(
 $core.method({
 selector: "testPragmaJSStatement",

+ 4 - 0
src/Compiler-Tests.st

@@ -350,6 +350,10 @@ testPascalCaseGlobal
 	self should: 'foo ^NonExistent' return: nil
 !
 
+testPragmaInBlock
+	self should: 'foo ^ [ < fooBar > 4 ] value' receiver: receiver raise: Error
+!
+
 testPragmaJSStatement
 	self should: 'foo < inlineJS: ''return 2+3'' >' return: 5
 !