[squeak-dev] The Inbox: Tests-cwp.150.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jul 20 18:55:02 UTC 2012


A new version of Tests was added to project The Inbox:
http://source.squeak.org/inbox/Tests-cwp.150.mcz

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

Name: Tests-cwp.150
Author: cwp
Time: 20 July 2012, 11:54:47.516 am
UUID: f3c34eb2-640c-4252-8da9-e6a1677d8ce0
Ancestors: Tests-bp.149

Introduced EnvironmentTest.

=============== Diff against Tests-bp.149 ===============

Item was changed:
  SystemOrganization addCategory: #'Tests-Exceptions'!
  SystemOrganization addCategory: #'Tests-Files'!
  SystemOrganization addCategory: #'Tests-Compiler'!
  SystemOrganization addCategory: #'Tests-Digital Signatures'!
  SystemOrganization addCategory: #'Tests-Object Events'!
  SystemOrganization addCategory: #'Tests-System-Support'!
  SystemOrganization addCategory: #'Tests-Bugs'!
  SystemOrganization addCategory: #'Tests-ObjectsAsMethods'!
  SystemOrganization addCategory: #'Tests-PrimCallController'!
  SystemOrganization addCategory: #'Tests-Release'!
  SystemOrganization addCategory: #'Tests-Utilities'!
  SystemOrganization addCategory: #'Tests-VM'!
  SystemOrganization addCategory: #'Tests-Hex'!
  SystemOrganization addCategory: #'Tests-Monticello'!
  SystemOrganization addCategory: #'Tests-Localization'!
  SystemOrganization addCategory: #'Tests-FilePackage'!
  SystemOrganization addCategory: #'Tests-Finalization'!
  SystemOrganization addCategory: #'Tests-Dependencies'!
  SystemOrganization addCategory: #'Tests-Monticello-Mocks'!
+ SystemOrganization addCategory: #'Tests-Environments'!

Item was added:
+ TestCase subclass: #EnvironmentTest
+ 	instanceVariableNames: 'env value'
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'Tests-Environments'!

Item was added:
+ ----- Method: EnvironmentTest>>createClass: (in category 'running') -----
+ createClass: aSymbol
+ 	| builder |
+ 	builder := ClassBuilder new.
+ 	builder
+ 		name: aSymbol
+ 		inEnvironment: env
+ 		subclassOf: Object
+ 		type: #normal
+ 		instanceVariableNames: ''
+ 		classVariableNames: ''
+ 		poolDictionaries: ''
+ 		category: 'Test'.
+ !

Item was added:
+ ----- Method: EnvironmentTest>>disabledTestInternalVisibility (in category 'compiling tests') -----
+ disabledTestInternalVisibility
+ 	| griffle plonk |
+ 	self createClass: #Griffle.
+ 	self createClass: #Plonk.
+ 	griffle := env at: #Griffle.
+ 	griffle compile: 'plonk ^ Plonk'.
+ 	plonk := griffle new plonk.
+ 	self assert: (env at: #Plonk) == plonk!

Item was added:
+ ----- Method: EnvironmentTest>>setUp (in category 'running') -----
+ setUp
+ 	env := Environment name: 'test'.
+ 	value := Object new.!

Item was added:
+ ----- Method: EnvironmentTest>>tearDown (in category 'running') -----
+ tearDown
+ 	env destroy!

Item was added:
+ ----- Method: EnvironmentTest>>testAtDoesntFindUndeclared (in category 'binding tests') -----
+ testAtDoesntFindUndeclared
+ 	env := Environment new.
+ 	env bindingOf: #Griffle.
+ 	self should: [ env at: #Griffle ] raise: KeyNotFound!

Item was added:
+ ----- Method: EnvironmentTest>>testAtIfAbsent (in category 'compatibility tests') -----
+ testAtIfAbsent
+ 	| result |
+ 	result := env at: #Griffle ifAbsent: [value].
+ 	self assert: result == value!

Item was added:
+ ----- Method: EnvironmentTest>>testAtIfAbsentNot (in category 'compatibility tests') -----
+ testAtIfAbsentNot
+ 	| result |
+ 	env at: #Griffle put: value.
+ 	result := env at: #Griffle ifAbsent: [self assert: false].
+ 	self assert: result == value!

Item was added:
+ ----- Method: EnvironmentTest>>testAtIfPresent (in category 'compatibility tests') -----
+ testAtIfPresent
+ 	| result |
+ 	env at: #Griffle put: value.
+ 	env at: #Griffle ifPresent: [:v | result := v].
+ 	self assert: result == value!

Item was added:
+ ----- Method: EnvironmentTest>>testAtIfPresentNot (in category 'compatibility tests') -----
+ testAtIfPresentNot
+ 	env at: #Griffle ifPresent: [self assert: false].!

Item was added:
+ ----- Method: EnvironmentTest>>testExplicitExport (in category 'export tests') -----
+ testExplicitExport
+ 	env requireExplicitExports.
+ 	env at: #Griffle put: value.
+ 	env export: #Griffle.
+ 	self assert: (env exports at: #Griffle) == value!

Item was added:
+ ----- Method: EnvironmentTest>>testImportFromOther (in category 'export tests') -----
+ testImportFromOther
+ 	| foreign |
+ 	foreign := Environment new.
+ 	foreign at: #Griffle put: value.
+ 	env importEnvironment: foreign.
+ 	self assert: (env bindingOf: #Griffle) value == value!

Item was added:
+ ----- Method: EnvironmentTest>>testReadOnlyBindings (in category 'binding tests') -----
+ testReadOnlyBindings
+ 	| binding class |
+ 	class := Behavior new.
+ 	env at: #Griffle put: class.
+ 	binding := env bindingOf: #Griffle.
+ 	self
+ 		should: [binding value: nil]
+ 		raise: AttemptToWriteReadOnlyGlobal!

Item was added:
+ ----- Method: EnvironmentTest>>testRequireExplicitExportIdempotency (in category 'export tests') -----
+ testRequireExplicitExportIdempotency
+ 	env requireExplicitExports.
+ 	env at: #Griffle put: value.
+ 	env export: #Griffle.
+ 	env requireExplicitExports.
+ 	self assert: (env exports includesKey: #Griffle)!

Item was added:
+ ----- Method: EnvironmentTest>>testRequireExplicitExports (in category 'export tests') -----
+ testRequireExplicitExports
+ 	env requireExplicitExports.
+ 	env at: #Griffle put: Object new.
+ 	self assert: env exports isEmpty!

Item was added:
+ ----- Method: EnvironmentTest>>testUndeclaredBindingMoved (in category 'binding tests') -----
+ testUndeclaredBindingMoved
+ 	| assoc |
+ 	assoc := env bindingOf: #Griffle.
+ 	env at: #Griffle put: value.
+ 	self assert: (env at: #Griffle) == value!

Item was added:
+ ----- Method: EnvironmentTest>>testWriteAndLookup (in category 'binding tests') -----
+ testWriteAndLookup
+ 	| assoc |
+ 	env at: #Griffle put: value.
+ 	assoc := env bindingOf: #Griffle.
+ 	self assert: assoc key == #Griffle.
+ 	self assert: assoc value == value.
+ 	!

Item was added:
+ ----- Method: EnvironmentTest>>testWriteAndRead (in category 'binding tests') -----
+ testWriteAndRead
+ 	env at: #Griffle put: value.
+ 	self assert: (env at: #Griffle) == value.!



More information about the Squeak-dev mailing list