[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

test[scripting] 530 - Compiler binarySelector

"testing binary selectors"
| binarySelectors |
binarySelectors := SmalltalkParser new binarySelectorChars.
binarySelectors do: [:op|
	ScriptCompilerTest implement: op ,' arg'
		comment: 'Perform ' ,op ,' operator'
		as: '^x ' ,op ,' y'
		category: #binarySelectors
].
binarySelectors do: [:op|
	(ScriptCompilerTest implements: op) ifFalse: [
		self error: 'Must implement ' ,op asLiteral
	]
].


ScriptCompilerTest implement: binarySelectors ,' arg'
	comment: 'Perform long operator'
	as: '^' ,binarySelectors asLiteral
	category: #binarySelectors.
(ScriptCompilerTest new perform: binarySelectors with: 12) = binarySelectors ifFalse: [
	self error: 'Must be ' ,binarySelectors asLiteral
].