Browse Source

Regression test for #438.

Herbert Vojčík 11 years ago
parent
commit
d17cf0c16d
3 changed files with 35 additions and 0 deletions
  1. 12 0
      js/Compiler-Tests.deploy.js
  2. 17 0
      js/Compiler-Tests.js
  3. 6 0
      st/Compiler-Tests.st

+ 12 - 0
js/Compiler-Tests.deploy.js

@@ -424,6 +424,18 @@ return self}, function($ctx1) {$ctx1.fill(self,"testAssignment",{},smalltalk.Cod
 messageSends: ["should:return:"]}),
 smalltalk.CodeGeneratorTest);
 
+smalltalk.addMethod(
+"_testBackslashSelectors",
+smalltalk.method({
+selector: "testBackslashSelectors",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(self)._should_return_("\x5c arg ^ 4",(4));
+_st(self)._should_return_("\x5c\x5c arg ^ 42",(42));
+return self}, function($ctx1) {$ctx1.fill(self,"testBackslashSelectors",{},smalltalk.CodeGeneratorTest)})},
+messageSends: ["should:return:"]}),
+smalltalk.CodeGeneratorTest);
+
 smalltalk.addMethod(
 "_testBlockReturn",
 smalltalk.method({

+ 17 - 0
js/Compiler-Tests.js

@@ -574,6 +574,23 @@ referencedClasses: []
 }),
 smalltalk.CodeGeneratorTest);
 
+smalltalk.addMethod(
+"_testBackslashSelectors",
+smalltalk.method({
+selector: "testBackslashSelectors",
+category: 'tests',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(self)._should_return_("\x5c arg ^ 4",(4));
+_st(self)._should_return_("\x5c\x5c arg ^ 42",(42));
+return self}, function($ctx1) {$ctx1.fill(self,"testBackslashSelectors",{},smalltalk.CodeGeneratorTest)})},
+args: [],
+source: "testBackslashSelectors\x0a\x09\x0a\x09self should: '\x5c arg ^ 4' return: 4.\x0a\x09self should: '\x5c\x5c arg ^ 42' return: 42",
+messageSends: ["should:return:"],
+referencedClasses: []
+}),
+smalltalk.CodeGeneratorTest);
+
 smalltalk.addMethod(
 "_testBlockReturn",
 smalltalk.method({

+ 6 - 0
st/Compiler-Tests.st

@@ -252,6 +252,12 @@ testAssignment
 	self should: 'foo | a | ^ a := true ifTrue: [ 1 ]' return: 1
 !
 
+testBackslashSelectors
+	
+	self should: '\ arg ^ 4' return: 4.
+	self should: '\\ arg ^ 42' return: 42
+!
+
 testBlockReturn
 	self should: 'foo ^ #(1 2 3) collect: [ :each | true ifTrue: [ each + 1 ] ]' return: #(2 3 4).
 	self should: 'foo ^ #(1 2 3) collect: [ :each | false ifFalse: [ each + 1 ] ]' return: #(2 3 4).