compiler/tests/PPCTokenGuardTest.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 24 Nov 2015 19:37:14 +0100
changeset 553 d83cb4945d5e
parent 528 ebfddc82b8bb
permissions -rw-r--r--
Oops, forgot to export PETITCOMPILER_DATA_DIRECTORY variable ...so Smalltalk code could not read it. Also fixed test for "include" scripts so they are not downloaded again when already downloaded.

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

"{ NameSpace: Smalltalk }"

TestCase subclass:#PPCTokenGuardTest
	instanceVariableNames:'guard compiler node tokenNode'
	classVariableNames:''
	poolDictionaries:''
	category:'PetitCompiler-Tests-Guards'
!


!PPCTokenGuardTest methodsFor:'as yet unclassified'!

setUp
    super setUp.
    compiler := PPCMockCompiler new.
!

testMakesSense
    tokenNode := PPCTokenNode new
        child: 'foo' asParser asCompilerTree.
    node := PPCPlusNode new
        child: tokenNode;
        yourself.	
    guard := PPCTokenGuard on: node.
    
    self assert: guard makesSense.
!

testMakesSense2
    node := PPCPlusNode new
        child: ('foo' asParser asCompilerTree);
        yourself.	
    guard := PPCTokenGuard on: node.
    
    self assert: guard makesSense not.
! !

!PPCTokenGuardTest class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
! !