islands/tests/PPMemoizingIslandTest.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 08 Oct 2014 00:33:44 +0100
changeset 387 e2b2ccaa4de6
child 389 009c2e13973c
permissions -rw-r--r--
Commited a island parser support (MC package PetitIslands) Name: PetitIslands-JanKurs.10 Author: JanKurs Time: 06-10-2014, 11:50:57 AM UUID: 19560ad2-4899-43d5-8c69-cf7274ad4f04 Repository: http://smalltalkhub.com/mc/Moose/PetitParser/main

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

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

PPMemoizingIslandTest comment:''
!

!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 ).
! !