removed container draft
authorClaus Gittinger <cg@exept.de>
Mon, 02 Jul 2018 07:35:04 +0200
changeset 561 9885688dbd3b
parent 560 d1fbb249043c
child 562 8e07a5704f6b
removed container
PPExtensionTest.st
--- a/PPExtensionTest.st	Mon Jul 02 07:34:58 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-"{ Package: 'stx:goodies/petitparser' }"
-
-PPAbstractParserTest subclass:#PPExtensionTest
-	instanceVariableNames:''
-	classVariableNames:''
-	poolDictionaries:''
-	category:'PetitTests-Tests'
-!
-
-
-!PPExtensionTest methodsFor:'testing-parser'!
-
-testCharacter
-	| parser |
-	parser := $a asParser.
-	self assert: parser parse: 'a' to: $a.
-	self assert: parser fail: 'b'
-!
-
-testChoice
-	| parser |
-	parser := #(1 2) asChoiceParser.
-	self assert: parser parse: #(1) to: 1.
-	self assert: parser parse: #(2) to: 2.
-	self assert: parser parse: #(1 2) to: 1 end: 1.
-	self assert: parser parse: #(2 1) to: 2 end: 1.
-	self assert: parser fail: #().
-	self assert: parser fail: #(3)
-!
-
-testClosure
-	| parser |
-	parser := [ :stream | stream upTo: $s ] asParser.
-	self assert: parser parse: '' to: ''.
-	self assert: parser parse: 'a' to: 'a'.
-	self assert: parser parse: 'aa' to: 'aa'.
-	self assert: parser parse: 's' to: ''.
-	self assert: parser parse: 'as' to: 'a'.
-	self assert: parser parse: 'aas' to: 'aa'.
-	self assert: parser parse: 'sa' to: '' end: 1.
-	self assert: parser parse: 'saa' to: '' end: 1.
-	
-	parser := [ :stream | stream upTo: $s. PPFailure message: 'stream' at: stream position ] asParser.
-	self assert: parser fail: ''.
-	self assert: parser fail: 's'.
-	self assert: parser fail: 'as'
-	
-!
-
-testEpsilon
-	| parser |
-	parser := nil asParser.
-	self assert: parser asParser = parser
-!
-
-testOrdered
-	| parser |
-	parser := #(1 2) asParser.
-	self assert: parser parse: #(1 2) to: #(1 2).
-	self assert: parser parse: #(1 2 3) to: #(1 2) end: 2.
-	self assert: parser fail: #().
-	self assert: parser fail: #(1).
-	self assert: parser fail: #(1 1).
-	self assert: parser fail: #(1 1 2)
-!
-
-testParser
-	| parser |
-	parser := $a asParser.
-	self assert: parser asParser = parser
-!
-
-testRange
-        | parser |
-        parser := ($a to: $c) asParser.
-        self assert: parser parse: 'a' to: $a.
-        self assert: parser parse: 'b' to: $b.
-        self assert: parser parse: 'c' to: $c.
-        self assert: parser fail: 'd'
-!
-
-testSequence
-	| parser |
-	parser := #(1 2) asSequenceParser.
-	self assert: parser parse: #(1 2) to: #(1 2).
-	self assert: parser parse: #(1 2 3) to: #(1 2) end: 2.
-	self assert: parser fail: #().
-	self assert: parser fail: #(1).
-	self assert: parser fail: #(1 1).
-	self assert: parser fail: #(1 1 2)
-!
-
-testString
-	| parser |
-	parser := 'ab' asParser.
-	self assert: parser parse: 'ab' to: 'ab'.
-	self assert: parser parse: 'aba' to: 'ab' end: 2.
-	self assert: parser parse: 'abb' to: 'ab' end: 2.
-	self assert: parser fail: 'a'.
-	self assert: parser fail: 'ac'
-!
-
-testSymbol
-	| parser |
-	parser := #any asParser.
-	self assert: parser parse: 'a'.
-	self assert: parser fail: ''
-!
-
-testUnordered
-	| parser |
-	parser := #(1 2) asSet asParser.
-	self assert: parser parse: #(1) to: 1.
-	self assert: parser parse: #(2) to: 2.
-	self assert: parser parse: #(1 2) to: 1 end: 1.
-	self assert: parser parse: #(2 1) to: 2 end: 1.
-	self assert: parser fail: #().
-	self assert: parser fail: #(3)
-! !
-
-!PPExtensionTest methodsFor:'testing-stream'!
-
-testStream
-	| stream |
-	stream := 'abc' readStream asPetitStream.
-	self assert: (stream class = PPStream).
-	self assert: (stream printString = '·abc').
-	self assert: (stream peek) = $a.
-	self assert: (stream uncheckedPeek = $a).
-	self assert: (stream next) = $a.
-	self assert: (stream printString = 'a·bc').
-	self assert: (stream asPetitStream = stream)
-!
-
-testText
-	| stream |
-	stream := 'abc' asText asPetitStream.
-	self assert: stream class = PPStream
-! !
-
-!PPExtensionTest class methodsFor:'documentation'!
-
-version
-    ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPExtensionTest.st,v 1.4 2014-03-04 14:34:17 cg Exp $'
-!
-
-version_CVS
-    ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPExtensionTest.st,v 1.4 2014-03-04 14:34:17 cg Exp $'
-!
-
-version_SVN
-    ^ '$Id: PPExtensionTest.st,v 1.4 2014-03-04 14:34:17 cg Exp $'
-! !
-