islands/tests/PPMemoizingIslandTest.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sat, 19 Mar 2016 00:12:47 +0100
changeset 556 51c6afba5c91
parent 454 a9cd5ea7cc36
permissions -rw-r--r--
CI: Use VM provided by Pharo team on both Linux and Windows. Hand-crafter Pharo VM is no longer needed as the Linux slave in SWING build farm has been upgraded so it has compatible GLIBC. This makes CI scripts simpler and more usable for other people.

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

"{ NameSpace: Smalltalk }"

PPIslandTest subclass:#PPMemoizingIslandTest
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'PetitIslands-Tests'
!

!PPMemoizingIslandTest class methodsFor:'as yet unclassified'!

shouldInheritSelectors 
	^ true.
! !

!PPMemoizingIslandTest methodsFor:'as yet unclassified'!

islandClass
	^ PPMemoizingIsland 
! !

!PPMemoizingIslandTest methodsFor:'testing'!

testMemo
	| parser  result1 result2 context input |
	
	parser := self island: ('class' asParser, self identifier, 'endclass' asParser).
	input := 'class Foo endclass' asPetitStream.
	
	context := PPContext new.
	
	result1 :=  parser parse: input withContext: context.
	result2 := parser parse: input withContext: context.
	self assert: (result1 == result2 ).
! !