Status: FixedWaitingToBePharoed
Owner: [email protected]
CC: [email protected]
Labels: Milestone-1.3 Difficulty-Easy

New issue 3678 by [email protected]: Refactored and extended CompilerExceptionsTest
http://code.google.com/p/pharo/issues/detail?id=3678

Levente Uzonyi uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-ul.110.mcz

==================== Summary ====================

Name: Tests-ul.110
Author: ul
Time: 12 January 2011, 2:03:05.15 pm
UUID: f26a4053-7b86-3348-954f-5f1ba3480af1
Ancestors: Tests-cmm.109

Refactored and extended CompilerExceptionsTest. One test case is failing. The corresponding bug report is here: http://bugs.squeak.org/view.php?id=7572 .

=============== Diff against Tests-cmm.109 ===============

Item was changed:
 TestCase subclass: #CompilerExceptionsTest
+       instanceVariableNames: 'text'
-       instanceVariableNames: ''
       classVariableNames: ''
       poolDictionaries: ''
       category: 'Tests-Compiler'!

Item was added:
+ ----- Method: CompilerExceptionsTest>>compile: (in category 'private') -----
+ compile: sourceString
+
+       text := sourceString.
+       self class
+               compileSilently: text
+               classified: 'generated'
+               notifying: self!

Item was added:
+ ----- Method: CompilerExceptionsTest>>compiling:shouldRaise: (in category 'private') -----
+ compiling: sourceCode shouldRaise: exceptionClass
+
+       self should: [ self compile: sourceCode ] raise: exceptionClass!

Item was removed:
- ----- Method: CompilerExceptionsTest>>griffle (in category 'as yet unclassified') -----
- griffle | goo |!

Item was added:
+ ----- Method: CompilerExceptionsTest>>removeGeneratedMethods (in category 'private') -----
+ removeGeneratedMethods
+
+       self class removeCategory: 'generated'!

Item was added:
+ ----- Method: CompilerExceptionsTest>>setUp (in category 'running') -----
+ setUp
+
+       self removeGeneratedMethods!

Item was added:
+ ----- Method: CompilerExceptionsTest>>tearDown (in category 'running') -----
+ tearDown
+
+       self removeGeneratedMethods!

Item was added:
+ ----- Method: CompilerExceptionsTest>>testAmbiguousSelector (in category 'tests') -----
+ testAmbiguousSelector
+
+       self
+               compiling: 'griffle ^1--1'
+               shouldRaise: AmbiguousSelector;
+               compiling: 'griffle ^1@-1'
+               shouldRaise: AmbiguousSelector;
+               compiling: 'griffle ^1+-1'
+               shouldRaise: AmbiguousSelector !

Item was changed:
----- Method: CompilerExceptionsTest>>testUndeclaredVariable (in category 'tests') -----
 testUndeclaredVariable
+
       self
+               compiling: 'griffle ^ goo'
+               shouldRaise: UndeclaredVariable;
+               compiling: 'griffle ^ [ goo ] value'
+               shouldRaise: UndeclaredVariable!
-               should:
-                       [self class
-                               compile: 'griffle ^ goo'
-                               notifying: self]
-               raise: UndeclaredVariable!

Item was changed:
----- Method: CompilerExceptionsTest>>testUndefinedVariable (in category 'tests') -----
 testUndefinedVariable
+
       self
+               compiling: 'griffle | goo | ^ goo'
+               shouldRaise: UndefinedVariable;
+               compiling: 'griffle [ | goo | ^ goo ] value'
+               shouldRaise: UndefinedVariable!
-               should:
-                       [self class
-                               compile: 'griffle | goo | ^ goo'
-                               notifying: self]
-               raise: UndefinedVariable!

Item was changed:
----- Method: CompilerExceptionsTest>>testUnknownSelector (in category 'tests') -----
 testUnknownSelector
+
       self
+ compiling: 'griffle self reallyHopeThisIsntImplementedAnywhere'
+               shouldRaise: UnknownSelector;
+ compiling: 'griffle [ self reallyHopeThisIsntImplementedAnywhere ] value'
+               shouldRaise: UnknownSelector!
-               should:
-                       [self class
- compile: 'griffle self reallyHopeThisIsntImplementedAnywhere'
-                               notifying: self]
-               raise: UnknownSelector!

Item was changed:
----- Method: CompilerExceptionsTest>>testUnusedVariable (in category 'tests') -----
 testUnusedVariable
+
       self
+               compiling: 'griffle | goo | ^nil'
+               shouldRaise: UnusedVariable;
+               compiling: 'griffle ^[ | goo | ]'
+               shouldRaise: UnusedVariable!
-               should:
-                       [self class
-                               compile: self unusedVariableSource
-                               notifying: self]
-               raise: UnusedVariable!

Item was changed:
 ----- Method: CompilerExceptionsTest>>text (in category 'emulating') -----
 text
+
+       ^text!
-       ^ self unusedVariableSource!

Item was removed:
- ----- Method: CompilerExceptionsTest>>unusedVariableSource (in category 'private') -----
- unusedVariableSource
-       ^ 'griffle
-               | goo |
-               ^ nil'!


Reply via email to