# HG changeset patch # User Jan Vrany # Date 1336169127 -7200 # Node ID 1e678b5f1423ddbe51c25dc987d2a6cba6593027 # Parent d602818dd055dce2a4a1f9bce5d74f2ab9315fb6 Checkin from browser diff -r d602818dd055 -r 1e678b5f1423 PPTokenTest.st --- a/PPTokenTest.st Sat May 05 00:05:16 2012 +0200 +++ b/PPTokenTest.st Sat May 05 00:05:27 2012 +0200 @@ -19,7 +19,7 @@ testCollection | input result | input := 'foo '. - result := self + result := self parse: input using: self identifier. self assert: (result collection = input). @@ -28,7 +28,7 @@ testNew self should: [ PPToken new ] raise: Error. - + ! testPrinting @@ -39,7 +39,7 @@ testSize | result | - result := self + result := self parse: 'foo' using: self identifier. self assert: result size = 3 @@ -47,7 +47,7 @@ testStart | result | - result := self + result := self parse: 'foo' using: self identifier. self assert: result start = 1 @@ -55,7 +55,7 @@ testStop | result | - result := self + result := self parse: 'foo' using: self identifier. self assert: result stop = 3 @@ -64,7 +64,7 @@ testValue | input result | input := 'foo'. - result := self + result := self parse: input using: self identifier. self assert: result value = input. @@ -88,7 +88,7 @@ | result other | result := PPToken on: 'abc'. other := result copyFrom: 2 to: 2. - + self assert: other size = 1. self assert: other start = 2. self assert: other stop = 2. @@ -102,7 +102,7 @@ input := '1' , (String with: Character cr) , '12' , (String with: Character cr with: Character lf) , '123' , (String with: Character lf) , '1234'. parser := #any asParser token star. result := parser parse: input. - result + result with: #(1 2 1 2 3 4 1 2 3 4 1 2 3 4) do: [ :token :line | self assert: token column = line ] ! @@ -112,8 +112,8 @@ input := '1' , (String with: Character cr) , '12' , (String with: Character cr with: Character lf) , '123' , (String with: Character lf) , '1234'. parser := #any asParser token star. result := parser parse: input. - result - with: #(1 1 2 2 2 2 3 3 3 3 4 4 4 4) + result + with: #(1 1 2 2 2 2 3 3 3 3 4 4 4 4) do: [ :token :line | self assert: token line = line ] ! ! @@ -125,6 +125,14 @@ !PPTokenTest class methodsFor:'documentation'! +version + ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPTokenTest.st,v 1.3 2012-05-04 22:05:27 vrany Exp $' +! + +version_CVS + ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPTokenTest.st,v 1.3 2012-05-04 22:05:27 vrany Exp $' +! + version_SVN - ^ '$Id: PPTokenTest.st,v 1.2 2012-01-13 11:22:50 cg Exp $' + ^ '§Id: PPTokenTest.st 4 2010-12-18 17:02:23Z kursjan §' ! !