Portability: fixes for Smalltalk/X
* Do not use detect:ifFound: - not present in Smalltalk/X
* Removed leftover debugging code (Halt if:, ...)
* Do not use `aClass methods`, use `aClass methodDictionary values`
* Do not use #allPairsDo; - not present in Smalltalk/X
* Do not use #crShow: - not present in Smalltalk/X
* On Smalltalk?X use Filename - there's no FileReference in Smalltalk/X
* Do not use CharacterSet, use String
"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }"
"{ NameSpace: Smalltalk }"
TestCase subclass:#PPCSmalltalkTests
instanceVariableNames:'configuration arguments'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Extras-Tests-Smalltalk'
!
!PPCSmalltalkTests methodsFor:'as yet unclassified'!
setUp
arguments := PPCArguments default
profile: true;
guards: false;
yourself.
configuration := PPCLL1Configuration new
arguments: arguments;
yourself.
!
testSmalltakToken
| token1 token2 |
arguments generate: false.
token1 := 'a' asParser smalltalkToken compileWithConfiguration: configuration.
token2 := 'b' asParser smalltalkToken compileWithConfiguration: configuration.
self assert: token1 tokenizer children first tokenClass = PPSmalltalkToken.
self assert: token1 tokenizer children first whitespace = token1 tokenizer children first whitespace.
!
testSmalltakWhitespace
| ws1 ws2 |
ws1 := PPSmalltalkWhitespaceParser new.
ws2 := PPSmalltalkWhitespaceParser new.
self assert: ws1 = ws2.
self assert: (ws1 == ws2) not.
self assert: ws1 hash = ws2 hash.
! !