[squeak-dev] The Trunk: Tests-eem.188.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Feb 11 21:35:01 UTC 2013


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'.!



More information about the Squeak-dev mailing list