PetitCommonMark/software/PetitMarkdown/PPLimitParserTest.class.st

29 lines
578 B
Smalltalk

Class {
#name : 'PPLimitParserTest',
#superclass : 'PPParserTest',
#instVars : [
'parser'
],
#category : 'PetitMarkdown-Tests'
}
{ #category : 'as yet unclassified' }
PPLimitParserTest >> testLimit [
| limiter foo |
limiter := #any asParser max: 3.
foo := 'foo' asParser.
parser := foo limitedBy: limiter.
self assert: parser parse: 'foo'.
]
{ #category : 'as yet unclassified' }
PPLimitParserTest >> testLimit2 [
| limiter foo |
limiter := #any asParser max: 2.
foo := 'foo' asParser.
parser := foo limitedBy: limiter.
self assert: parser fail: 'foo'.
]