343
|
1 |
"{ Package: 'stx:goodies/petitparser/gui/tests' }"
|
|
2 |
|
|
3 |
TestCase subclass:#PPParserDebuggerResultTest
|
|
4 |
instanceVariableNames:''
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'PetitGui-Tests'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!PPParserDebuggerResultTest methodsFor:'tests'!
|
|
12 |
|
|
13 |
testArithmetic
|
|
14 |
| parser result |
|
|
15 |
parser := PPArithmeticParser new.
|
|
16 |
result := PPParserDebuggerResult parse: '1 + 2' with: parser.
|
|
17 |
self assert: result children size = 1.
|
|
18 |
self assert: result children first result = 3
|
|
19 |
!
|
|
20 |
|
|
21 |
testNumberParser
|
|
22 |
| parser result |
|
|
23 |
parser := PPArithmeticParser new productionAt: #number.
|
|
24 |
result := PPParserDebuggerResult parse: '1' with: parser.
|
|
25 |
self assert: result children isEmpty.
|
|
26 |
self assert: result result = 1
|
|
27 |
! !
|
|
28 |
|
|
29 |
!PPParserDebuggerResultTest class methodsFor:'documentation'!
|
|
30 |
|
|
31 |
version
|
|
32 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/gui/tests/PPParserDebuggerResultTest.st,v 1.1 2014-03-04 21:16:27 cg Exp $'
|
|
33 |
!
|
|
34 |
|
|
35 |
version_CVS
|
|
36 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/gui/tests/PPParserDebuggerResultTest.st,v 1.1 2014-03-04 21:16:27 cg Exp $'
|
|
37 |
! !
|
|
38 |
|