forked from pharo-project/pharo
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes: pharo-project#5428 resync enlumineur
- Loading branch information
Showing
16 changed files
with
847 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
Class { | ||
#name : #EFBenchTest, | ||
#superclass : #TestCase, | ||
#category : #'EnlumineurFormatter-Tests' | ||
} | ||
|
||
{ #category : #tests } | ||
EFBenchTest >> basicMethod [ | ||
[[[[[ [ | ||
[ :y :z | | ||
[ :x | 1 to: 10 do: [:i | Transcript show:i ; cr ;cr] ]]] | ||
]]]]] | ||
] | ||
|
||
{ #category : #tests } | ||
EFBenchTest >> basicMethod2 [ | ||
<sampleInstance> | ||
|
||
1 to: 10 do: [:i | Transcript show:i ; cr ;cr] | ||
|
||
] | ||
|
||
{ #category : #tests } | ||
EFBenchTest >> basicMethod3 [ | ||
"a method with many similar expressions." | ||
| x y | | ||
x to: y do: [:i | Transcript show:i ; cr ;cr]. | ||
x to: y do: [:i | Transcript show:i ; cr ;cr]. | ||
x to: y do: [:i | Transcript show:i ; cr: x ; cr: x ]. | ||
|
||
] | ||
|
||
{ #category : #resources } | ||
EFBenchTest >> longNestedMethod [ | ||
|
||
self foo: [ :b1 | | ||
b1 value: [ :b2 | | ||
b2 value: [ :b3 | | ||
b2 value: [ :b4 | | ||
b3 value: [ :b5 | | ||
b4 value: [ :b6 | | ||
b5 value: [ :b7 | | ||
b6 value: [ :b8| | ||
b7 value: [ :b9 | | ||
b8 value: [ :b10 | | ||
b9 value: 2] ] ] ]] ] ] ] ] ] | ||
] | ||
|
||
{ #category : #resources } | ||
EFBenchTest >> longNestedMethodShort [ | ||
| b0 | | ||
self value: [:b1 | b0 value: [:b2 | b1 value: [:b3 | b2 value: [:b4 | b3 value: [:b5 | b4 value: [:b6 | b5 value: [:b7 | b7 value: 2 ] ] ] ] ] ] ] | ||
] | ||
|
||
{ #category : #tests } | ||
EFBenchTest >> testBasicBlueInk [ | ||
|
||
BIConfigurableFormatter format: (EFBenchTest >> #basicMethod) ast | ||
] | ||
|
||
{ #category : #tests } | ||
EFBenchTest >> testBasicEF [ | ||
self skip. | ||
[ EFFormatter format: (EFBenchTest >> #basicMethod) ast ] bench | ||
] | ||
|
||
{ #category : #tests } | ||
EFBenchTest >> testBasicEF2 [ | ||
|
||
EFFormatter format: (EFBenchTest >> #basicMethod2) ast | ||
] | ||
|
||
{ #category : #tests } | ||
EFBenchTest >> testEF [ | ||
" | ||
[ EFFormatter format: (EFBenchTest >> #longNestedMethodShort) ast ] bench '0.159 per second' | ||
[ RBSimpleFormatter format: (EFBenchTest >> #longNestedMethodShort) ast ] bench | ||
>>>'15597.361 per second' | ||
[ BIConfigurableFormatter format: (EFBenchTest >> #longNestedMethodShort) ast ] bench '7341.000 per second' | ||
" | ||
] |
Oops, something went wrong.