[Pkg] The Trunk: Tests-topa.309.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Jan 21 09:35:27 UTC 2015


Tobias Pape uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-topa.309.mcz

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

Name: Tests-topa.309
Author: topa
Time: 21 January 2015, 10:35:14.311 am
UUID: 351b14f2-b099-430e-bd63-0cee8756f68f
Ancestors: Tests-topa.308

Reinstall the 'new binding' condition in class renames.
Also test that literals still work after renaming.

=============== Diff against Tests-topa.308 ===============

Item was removed:
- ----- Method: EnvironmentTest>>expectedFailures (in category 'as yet unclassified') -----
- expectedFailures
- 	" The need for fresh bindings on class rename may be a good idea,
- 	  we don't know yet. Need to talk to cwp, probably"
- 
- 	^ #(testRenameCreatesNewBinding)!

Item was added:
+ ----- Method: EnvironmentTest>>testRenameContinuity (in category 'class tests') -----
+ testRenameContinuity
+ 	"When we rename a class, literal references to it 
+ 	from method bytecode should still work even though
+ 	they are now undeclared."
+ 
+ 	| class |
+ 	env importSelf.
+ 	class := self createClass: #Griffle.
+ 	class compileSilently: 'foo ^ Griffle new' classified: ''.
+ 	self shouldnt: [class new foo] raise: Error.
+ 	self assert: class equals: class new foo class description: '<failsafe>'.
+ 
+ 	class rename: #Plonk.
+ 	self shouldnt: [class new foo] raise: Error.
+ 	self
+ 		assert: class
+ 		equals: class new foo class
+ 		description: 'The value of the binding should still be intact after a class rename'.
+ 	!

Item was changed:
  ----- Method: EnvironmentTest>>testRenameCreatesNewBinding (in category 'class tests') -----
  testRenameCreatesNewBinding
  	"When we rename a class, a completely new 
  	binding should be created for the new name.
+ 	The old binding is moved to undeclared."
- 	The old binding is moved to undeclared, and
- 	given a null value."
  
  	| class newBinding oldBinding |
  	env importSelf.
  	class := self createClass: #Griffle.
  	oldBinding := env bindingOf: #Griffle.
  	class rename: #Plonk.
  	newBinding := env bindingOf: #Plonk.
  	self deny: newBinding == oldBinding.
  	
+ 	self assert: class identical: oldBinding value.
- 	self assert: nil identical: oldBinding value.
  	self assert: #Griffle equals: oldBinding key.
  	
  	self assert: #Plonk equals: newBinding key.
  	self assert: class identical: newBinding value.
  	!



More information about the Packages mailing list