The Trunk: Tests-nice.277.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-nice.277.mcz

commits-2
Nicolas Cellier uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-nice.277.mcz

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

Name: Tests-nice.277
Author: nice
Time: 16 December 2013, 4:25:42.334 pm
UUID: 79ee04ec-ef87-4c8e-90bd-9f99e43d0e20
Ancestors: Tests-fbs.276

Use non logging Compiler protocol rather than providing a logged: false argument.

=============== Diff against Tests-fbs.276 ===============

Item was changed:
  ----- Method: CompilerNotifyingTest>>evaluateSelection (in category 'private') -----
  evaluateSelection
  ^(nil class evaluatorClass new)
  evaluate: morph editor selectionAsStream
  in: nil
  to: nil
  notifying: morph editor
  ifFail: [^failure]
- logged: false
  !

Item was changed:
  ----- Method: CompilerSyntaxErrorNotifyingTest>>evaluateSelection (in category 'private') -----
  evaluateSelection
  ^(nil class evaluatorClass new)
  evaluate: morph editor selection readStream
  "Note subtle difference versus  (morph editor selectionAsStream).
  The later does not answer the same contents and would raise a SyntaxErrorNotification with wrong sub-selection"
  in: nil
  to: nil
  notifying: nil
+ ifFail: [^failure]!
- ifFail: [^failure]
- logged: false!

Item was changed:
  ----- Method: CompilerTest>>testEvaluationOfInlinedToDo (in category 'testing') -----
  testEvaluationOfInlinedToDo
  "Whether inlined or not, #to:do: should return the same value"
  | inlinedResult notInlinedResult |
  inlinedResult := Compiler new
  evaluate: '1+1 to: 0 do: [:i | ]'
  in: nil
  to: nil
  notifying: nil
+ ifFail: [^ #failedDoit].
- ifFail: [^ #failedDoit]
- logged: false.
  notInlinedResult := Compiler new
  evaluate: '| aBlock | aBlock := [:i | ]. 1+1 to: 0 do: aBlock'
  in: nil
  to: nil
  notifying: nil
+ ifFail: [^ #failedDoit].
- ifFail: [^ #failedDoit]
- logged: false.
  self assert: inlinedResult = notInlinedResult!

Item was changed:
  ----- Method: CompilerTest>>testMaxLiterals (in category 'limits') -----
  testMaxLiterals
  "Document the maximum number of literals in a compiled method"
 
  | maxLiterals stringThatCanBeCompiled stringWithOneTooManyLiterals |
  maxLiterals := 249.
  stringThatCanBeCompiled := '{ ', (String streamContents: [:strm |
  1 to: maxLiterals do: [:e | strm nextPutAll: '''', e asString, '''', ' . ']]), '}'.
  stringWithOneTooManyLiterals := '{ ', (String streamContents: [:strm |
  1 to: maxLiterals + 1 do: [:e | strm nextPutAll: '''', e asString, '''', ' . ']]), '}'.
+ self assert: ((1 to: maxLiterals) collect: #printString) equals: (Compiler evaluate: stringThatCanBeCompiled).
- self assert: ((1 to: 249) asArray collect: #printString) equals: (Compiler evaluate: stringThatCanBeCompiled logged: false).
- self should: (Compiler evaluate: stringThatCanBeCompiled logged: false) size = maxLiterals.
 
  "If the following test fails, it means that the limit has been raised or eliminated,
  and this test should be updated to reflect the improvement."
+ self should: [Compiler evaluate: stringWithOneTooManyLiterals] raise: Error.
- self should: [Compiler evaluate: stringWithOneTooManyLiterals logged: false] raise: Error.
  !

Item was changed:
  ----- Method: CompilerTest>>testMaxLiteralsWithClassReferenceInClosure (in category 'limits') -----
  testMaxLiteralsWithClassReferenceInClosure
  "Document the maximum number of literals in a compiled method. A class
  reference in a closure reduces the maximum literals."
 
  | maxLiterals stringThatCanBeCompiled stringWithOneTooManyLiterals |
  maxLiterals := 244.
  stringThatCanBeCompiled := '[ DateAndTime now. Date today. Time ]. { ',
  (String streamContents: [:strm |
  1 to: maxLiterals do: [:e | strm nextPutAll: '''', e asString, '''', ' . ']]), '}'.
  stringWithOneTooManyLiterals := '[ DateAndTime now. Date today. Time ]. { ',
  (String streamContents: [:strm |
  1 to: maxLiterals + 1 do: [:e | strm nextPutAll: '''', e asString, '''', ' . ']]), '}'.
+ self assert: maxLiterals equals: (Compiler evaluate: stringThatCanBeCompiled) size.
- self assert: maxLiterals equals: (Compiler evaluate: stringThatCanBeCompiled logged: false) size.
 
  "If the following test fails, it means that the limit has been raised or eliminated,
  and this test should be updated to reflect the improvement."
+ self should: [Compiler evaluate: stringWithOneTooManyLiterals] raise: Error.
- self should: [Compiler evaluate: stringWithOneTooManyLiterals logged: false] raise: Error.
  !