Browse Source

Regression test for #190.

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

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

@@ -560,6 +560,18 @@ return self}, function($ctx1) {$ctx1.fill(self,"testNonLocalReturn",{},smalltalk
 messageSends: ["should:return:"]}),
 smalltalk.CodeGeneratorTest);
 
+smalltalk.addMethod(
+"_testPascalCaseGlobal",
+smalltalk.method({
+selector: "testPascalCaseGlobal",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(self)._should_return_("foo ^Object",_st(smalltalk)._at_("Object"));
+_st(self)._should_return_("foo ^NonExistent",nil);
+return self}, function($ctx1) {$ctx1.fill(self,"testPascalCaseGlobal",{},smalltalk.CodeGeneratorTest)})},
+messageSends: ["should:return:", "at:"]}),
+smalltalk.CodeGeneratorTest);
+
 smalltalk.addMethod(
 "_testSendReceiverAndArgumentsOrdered",
 smalltalk.method({

+ 17 - 0
js/Compiler-Tests.js

@@ -765,6 +765,23 @@ referencedClasses: []
 }),
 smalltalk.CodeGeneratorTest);
 
+smalltalk.addMethod(
+"_testPascalCaseGlobal",
+smalltalk.method({
+selector: "testPascalCaseGlobal",
+category: 'tests',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
_st(self)._should_return_("foo ^Object",_st(smalltalk)._at_("Object"));
+_st(self)._should_return_("foo ^NonExistent",nil);
+return self}, function($ctx1) {$ctx1.fill(self,"testPascalCaseGlobal",{},smalltalk.CodeGeneratorTest)})},
+args: [],
+source: "testPascalCaseGlobal\x0a\x09self should: 'foo ^Object' return: (smalltalk at: 'Object').\x0a\x09self should: 'foo ^NonExistent' return: nil",
+messageSends: ["should:return:", "at:"],
+referencedClasses: []
+}),
+smalltalk.CodeGeneratorTest);
+
 smalltalk.addMethod(
 "_testSendReceiverAndArgumentsOrdered",
 smalltalk.method({

+ 5 - 0
st/Compiler-Tests.st

@@ -356,6 +356,11 @@ testNonLocalReturn
 	self should: 'foo [ :x | ^ x + x ] value: 4. ^ 2' return: 8
 !
 
+testPascalCaseGlobal
+	self should: 'foo ^Object' return: (smalltalk at: 'Object').
+	self should: 'foo ^NonExistent' return: nil
+!
+
 testSendReceiverAndArgumentsOrdered
 	self should: 'foo
 	| x |