tests/PPAbstractParserTest.st
changeset 427 a7f5e6de19d2
parent 385 44a36ed4e484
equal deleted inserted replaced
426:2a65c972b937 427:a7f5e6de19d2
     1 "{ Package: 'stx:goodies/petitparser/tests' }"
     1 "{ Package: 'stx:goodies/petitparser/tests' }"
       
     2 
       
     3 "{ NameSpace: Smalltalk }"
     2 
     4 
     3 TestCase subclass:#PPAbstractParserTest
     5 TestCase subclass:#PPAbstractParserTest
     4 	instanceVariableNames:''
     6 	instanceVariableNames:''
     5 	classVariableNames:''
     7 	classVariableNames:''
     6 	poolDictionaries:''
     8 	poolDictionaries:''
    47 		description: 'Parser did not fail'.
    49 		description: 'Parser did not fail'.
    48 	self
    50 	self
    49 		assert: context position = anInteger
    51 		assert: context position = anInteger
    50 		description: 'Parser failed at wrong position'.
    52 		description: 'Parser failed at wrong position'.
    51 	^ result
    53 	^ result
       
    54 !
       
    55 
       
    56 assert: string1 includesSubstring: string2
       
    57 	"Support portability by using ANSI search method"
       
    58 
       
    59 	self assert: (string1 notEmpty and: [string2 notEmpty and: [0 < (string1 indexOfSubCollection: string2 startingAt: 1)]])
    52 !
    60 !
    53 
    61 
    54 assert: aParser parse: aCollection
    62 assert: aParser parse: aCollection
    55 	^ self assert: aParser parse: aCollection to: nil end: aCollection size 
    63 	^ self assert: aParser parse: aCollection to: nil end: aCollection size 
    56 !
    64 !