[Pkg] The Trunk: Tests-nice.252.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Sep 17 21:40:04 UTC 2013
Nicolas Cellier uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-nice.252.mcz
==================== Summary ====================
Name: Tests-nice.252
Author: nice
Time: 17 September 2013, 11:39:12.086 pm
UUID: 25290b22-c4da-4cd0-9d05-0aabdd522415
Ancestors: Tests-ul.251
Replace invocation of two internal (private ?) Compiler methods with a single (public ?) one.
=============== Diff against Tests-ul.251 ===============
Item was changed:
----- Method: ClosureCompilerTest>>testBlockDoitDecompilation (in category 'tests') -----
testBlockDoitDecompilation
"Tests that decompile of a doit block with remote vars executes correcly"
"Tests that decompilation of a Block, when 'method' of block is equivalent to that compiled by a DoIt, preserves the temp names "
|blockSourceStream methodNode compiledMethod block decompiledBlock|
blockSourceStream := '|x y| [:a :b | x := a. y := b. x + y]' readStream.
methodNode := nil class evaluatorClass new
+ compileNoPattern: blockSourceStream in: nil class context: nil notifying: nil ifFail: [nil]..
- from: blockSourceStream class: nil class context: nil notifying: nil;
- translate: blockSourceStream noPattern: true ifFail: [nil].
compiledMethod := methodNode generateWithTempNames.
block := nil withArgs: #() executeMethod: compiledMethod.
self shouldnt: [decompiledBlock := block decompile] raise: Error.
self assert: '{[:a :b |
x := a.
y := b.
x + y]}' equals: decompiledBlock printString
!
Item was changed:
----- Method: CompilerTest>>testBinarySelectorWithBar (in category 'syntax') -----
testBinarySelectorWithBar
"Acknowledge the fact that $| is now allowed at any place in a binary selector"
#(#'||' #'|||' #'|||++' #'<|>') do: [:selector | | source tree |
source := ('1 ' , selector , ' 2') readStream.
tree := (Compiler new)
+ compileNoPattern: source in: Object context: nil notifying: nil ifFail: [nil].
- from: source class: Object context: nil notifying: nil;
- translate: source noPattern: true ifFail: [nil].
self assert: tree notNil.
"Hem, this test is really ugly..."
self assert: tree block statements first expr selector key = selector].!
Item was changed:
----- Method: CompilerTest>>testBinarySelectorWithMinus (in category 'syntax') -----
testBinarySelectorWithMinus
"Acknowledge the fact that $- is now allowed at any place in a binary selector"
| source tree |
source := '1 @- 2' readStream.
tree := (Compiler new)
+ compileNoPattern: source in: Object context: nil notifying: nil ifFail: [nil].
- from: source class: Object context: nil notifying: nil;
- translate: source noPattern: true ifFail: [nil].
self assert: tree notNil.
"Hem, this test is really ugly..."
self assert: tree block statements first expr selector key = #'@-'.!
More information about the Packages
mailing list