gui/tests/PPParserDebuggerResultTest.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 07 Sep 2015 11:53:38 +0100
changeset 538 16e8536f5cfb
parent 343 0faf1af65792
permissions -rw-r--r--
PPCConfiguration refactoring: [10/10]: Cleaned up compilation API The main compilation method is now PPParser>>compileWithOptions: Removed oither old and unused compilation methods from PPParser and other PetitCompiler classes.

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

TestCase subclass:#PPParserDebuggerResultTest
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'PetitGui-Tests'
!


!PPParserDebuggerResultTest methodsFor:'tests'!

testArithmetic
	| parser result |
	parser := PPArithmeticParser new.
	result := PPParserDebuggerResult parse: '1 + 2' with: parser.
	self assert: result children size = 1.
	self assert: result children first result = 3
!

testNumberParser
	| parser result |
	parser := PPArithmeticParser new productionAt: #number.
	result := PPParserDebuggerResult parse: '1' with: parser.
	self assert: result children isEmpty.
	self assert: result result = 1
! !

!PPParserDebuggerResultTest class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/goodies/petitparser/gui/tests/PPParserDebuggerResultTest.st,v 1.1 2014-03-04 21:16:27 cg Exp $'
!

version_CVS
    ^ '$Header: /cvs/stx/stx/goodies/petitparser/gui/tests/PPParserDebuggerResultTest.st,v 1.1 2014-03-04 21:16:27 cg Exp $'
! !