The Trunk: Tests-eem.188.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Tests-eem.188.mcz

commits-2
Eliot Miranda uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-eem.188.mcz

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

Name: Tests-eem.188
Author: eem
Time: 11 February 2013, 1:34:36.696 pm
UUID: 2296dfd5-4616-422a-b338-11acc523e468
Ancestors: Tests-fbs.187

Provde a test for Compiler-eem.251 which shows its still
broken.  I fixed decompilation of
        true ifTrue: [^thisContext method decompile].
        ^nil to: 3 do: [:i| i class]
but /not/ decompilation of
        ^nil to: 3 do: [:i| i class]
       
tsk, tsk.

=============== Diff against Tests-fbs.187 ===============

Item was added:
+ ----- Method: DecompilerTests>>testDecompileAnswerToDoLoop (in category 'tests') -----
+ testDecompileAnswerToDoLoop
+ "This is a non regression test for Compiler-nice.224."
+ "DecompilerTests new testDecompileAnswerToDoLoop"
+ | sourceCode mn decompiledCode  |
+ sourceCode := '^nil to: 3 do: [:i| i class]'.
+ self
+ shouldnt: [mn := self class newCompiler compileNoPattern: sourceCode in: self class context: nil notifying: nil ifFail: [self error: 'failed']]
+ raise: Error.
+ self
+ shouldnt: [decompiledCode := mn generateWithTempNames decompileWithTemps asString]
+ raise: Error.
+ "This to avoid getting fooled by changes in decompilation due to code formatting preferences."
+ decompiledCode := decompiledCode copyReplaceAll: {Character cr. Character tab. Character tab } with: ' '.
+ decompiledCode := decompiledCode copyReplaceAll: '^ ' with: '^'.
+ decompiledCode := decompiledCode copyReplaceAll: ' |' with: '|'.
+ self
+ assert: (decompiledCode endsWith: sourceCode)
+ description: 'decompilation should match source'.!