Przeglądaj źródła

Small updates to test related to new inline JS form.

Herbert Vojčík 7 lat temu
rodzic
commit
79f8e3e0af
2 zmienionych plików z 42 dodań i 42 usunięć
  1. 33 33
      src/Compiler-Tests.js
  2. 9 9
      src/Compiler-Tests.st

+ 33 - 33
src/Compiler-Tests.js

@@ -158,7 +158,7 @@ var ast,visitor;
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $3,$2,$1;
-ast=self._parse_forClass_("foo <consolee.log(1)>",$globals.Object);
+ast=self._parse_forClass_("foo <inlineJS: 'consolee.log(1)'>",$globals.Object);
 $3=self._astPCNodeVisitor();
 $recv($3)._visit_(ast);
 $2=$recv($3)._currentNode();
@@ -171,7 +171,38 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "testJSStatementNode\x0a\x09| ast visitor |\x0a\x09\x0a\x09ast := self parse: 'foo <consolee.log(1)>' forClass: Object.\x0a\x09self assert: (self astPCNodeVisitor\x0a\x09\x09visit: ast;\x0a\x09\x09currentNode) isJSStatementNode",
+source: "testJSStatementNode\x0a\x09| ast visitor |\x0a\x09\x0a\x09ast := self parse: 'foo <inlineJS: ''consolee.log(1)''>' forClass: Object.\x0a\x09self assert: (self astPCNodeVisitor\x0a\x09\x09visit: ast;\x0a\x09\x09currentNode) isJSStatementNode",
+referencedClasses: ["Object"],
+//>>excludeEnd("ide");
+messageSends: ["parse:forClass:", "assert:", "isJSStatementNode", "visit:", "astPCNodeVisitor", "currentNode"]
+}),
+$globals.ASTPCNodeVisitorTest);
+
+$core.addMethod(
+$core.method({
+selector: "testLegacyJSStatementNode",
+protocol: 'tests',
+fn: function (){
+var self=this;
+var ast,visitor;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $3,$2,$1;
+ast=self._parse_forClass_("foo <consolee.log(1)>",$globals.Object);
+$3=self._astPCNodeVisitor();
+$recv($3)._visit_(ast);
+$2=$recv($3)._currentNode();
+$1=$recv($2)._isJSStatementNode();
+self._assert_($1);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"testLegacyJSStatementNode",{ast:ast,visitor:visitor},$globals.ASTPCNodeVisitorTest)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "testLegacyJSStatementNode\x0a\x09| ast visitor |\x0a\x09\x0a\x09ast := self parse: 'foo <consolee.log(1)>' forClass: Object.\x0a\x09self assert: (self astPCNodeVisitor\x0a\x09\x09visit: ast;\x0a\x09\x09currentNode) isJSStatementNode",
 referencedClasses: ["Object"],
 //>>excludeEnd("ide");
 messageSends: ["parse:forClass:", "assert:", "isJSStatementNode", "visit:", "astPCNodeVisitor", "currentNode"]
@@ -327,37 +358,6 @@ messageSends: ["parse:forClass:", "assert:", "isNil", "visit:", "astPCNodeVisito
 }),
 $globals.ASTPCNodeVisitorTest);
 
-$core.addMethod(
-$core.method({
-selector: "testPC",
-protocol: 'tests',
-fn: function (){
-var self=this;
-var ast,visitor;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-var $3,$2,$1;
-ast=self._parse_forClass_("foo <console.log(1)>",$globals.Object);
-$3=self._astPCNodeVisitor();
-$recv($3)._visit_(ast);
-$2=$recv($3)._currentNode();
-$1=$recv($2)._isJSStatementNode();
-self._assert_($1);
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"testPC",{ast:ast,visitor:visitor},$globals.ASTPCNodeVisitorTest)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "testPC\x0a\x09| ast visitor |\x0a\x09\x0a\x09ast := self parse: 'foo <console.log(1)>' forClass: Object.\x0a\x09self assert: (self astPCNodeVisitor\x0a\x09\x09visit: ast;\x0a\x09\x09currentNode) isJSStatementNode",
-referencedClasses: ["Object"],
-//>>excludeEnd("ide");
-messageSends: ["parse:forClass:", "assert:", "isJSStatementNode", "visit:", "astPCNodeVisitor", "currentNode"]
-}),
-$globals.ASTPCNodeVisitorTest);
-
 
 
 $core.addClass('ASTPositionTest', $globals.ASTParsingTest, [], 'Compiler-Tests');

+ 9 - 9
src/Compiler-Tests.st

@@ -46,6 +46,15 @@ astPCNodeVisitorForSelector: aString
 testJSStatementNode
 	| ast visitor |
 	
+	ast := self parse: 'foo <inlineJS: ''consolee.log(1)''>' forClass: Object.
+	self assert: (self astPCNodeVisitor
+		visit: ast;
+		currentNode) isJSStatementNode
+!
+
+testLegacyJSStatementNode
+	| ast visitor |
+	
 	ast := self parse: 'foo <consolee.log(1)>' forClass: Object.
 	self assert: (self astPCNodeVisitor
 		visit: ast;
@@ -91,15 +100,6 @@ testNoMessageSend
 	self assert: (self astPCNodeVisitor
 		visit: ast;
 		currentNode) isNil
-!
-
-testPC
-	| ast visitor |
-	
-	ast := self parse: 'foo <console.log(1)>' forClass: Object.
-	self assert: (self astPCNodeVisitor
-		visit: ast;
-		currentNode) isJSStatementNode
 ! !
 
 ASTParsingTest subclass: #ASTPositionTest