compiler/tests/extras/PPCJavaTests.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 08 Sep 2015 02:49:45 +0100
changeset 544 69b6f2f0df1d
parent 524 f6f68d32de73
permissions -rw-r--r--
Portabiluty: use `Exception new signal: message` to throw exceptions ...instead of #signalWith: It seems that this is the only portable way to throw exceptions (at least among Pharo and Smalltalk/X)

"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }"

"{ NameSpace: Smalltalk }"

TestCase subclass:#PPCJavaTests
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'PetitCompiler-Extras-Tests-Java'
!

!PPCJavaTests methodsFor:'as yet unclassified'!

javaWsNode
    ^ PPCUnknownNode new
        parser: PPJavaWhitespaceParser new;
        yourself
!

testJavaWS
    | node1 node2 node visitor |
    node1 := self javaWsNode.
    node2 := self javaWsNode.
    
    node := PPCSequenceNode new
        children: { node1 . node2 }.

    visitor := PPCMergingVisitor new.
        
    self assert: (node children first == node children second) not.
    node := visitor visit: node.
    self assert: (node children first == node children second).
! !