tests/PPParserTest.st
changeset 380 8fe3cb4e607f
parent 379 451b5ae38b72
child 405 0470a5e6e712
--- a/tests/PPParserTest.st	Fri Oct 03 03:11:33 2014 +0100
+++ b/tests/PPParserTest.st	Sun Oct 05 00:05:20 2014 +0100
@@ -931,21 +931,23 @@
 !
 
 testPrint
-	| parser |
-	parser := PPParser new.
-	self assert: (parser printString includesSubstring: 'PPParser').
-	
-	parser := PPParser named: 'choice'.
-	self assert: (parser printString includesSubstring: 'PPParser(choice').
-	
-	parser := PPLiteralObjectParser on: $a.
-	self assert: (parser printString includesSubstring: '$a').
-	
-	parser := PPFailingParser message: 'error'.
-	self assert: (parser printString includesSubstring: 'error').
-	
-	parser := PPPredicateObjectParser on: [ :c | true ] message: 'error'.
-	self assert: (parser printString includesSubstring: 'error')
+        | parser |
+        parser := PPParser new.
+        self assert: (parser printString includesSubstring: 'PPParser').
+        
+        parser := PPParser named: 'choice'.
+        self assert: (parser printString includesSubstring: 'PPParser(choice').
+        
+        parser := PPLiteralObjectParser on: $a.
+        self assert: (parser printString includesSubstring: $a printString).
+        
+        parser := PPFailingParser message: 'error'.
+        self assert: (parser printString includesSubstring: 'error').
+        
+        parser := PPPredicateObjectParser on: [ :c | true ] message: 'error'.
+        self assert: (parser printString includesSubstring: 'error')
+
+    "Modified: / 03-10-2014 / 23:43:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !PPParserTest methodsFor:'testing-fixtures'!
@@ -1456,16 +1458,16 @@
         parser := $a asParser.
         self assert: (parser parse: 'a') equals: $a.
         self assert: (result := parser parse: 'b') isPetitFailure.
-        self assert: (result message includesSubstring: '$a').
+        self assert: (result message includesSubstring: $a printString).
         self assert: (result message includesSubstring: 'expected').
         self assert: result position equals: 0.
         self assert: (parser parse: 'a' readStream) equals: $a.
         self assert: (result := parser parse: 'b' readStream) isPetitFailure.
-        self assert: (result message includesSubstring: '$a').
+        self assert: (result message includesSubstring: $a printString).
         self assert: (result message includesSubstring: 'expected').
         self assert: result position equals: 0
 
-    "Modified (format): / 03-10-2014 / 02:48:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 03-10-2014 / 23:42:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 testParseOnError0
@@ -1479,35 +1481,39 @@
 !
 
 testParseOnError1
-	| parser result seen |
-	parser := $a asParser.
-	result := parser parse: 'a' onError: [ self signalFailure: 'Not supposed to report an error' ].
-	self assert: result equals: $a.
-	result := parser
-		parse: 'b'
-		onError: [ :failure | 
-			self assert: failure position equals: 0.
-			self assert: (failure message includesSubstring: '$a').
-			self assert: (failure message includesSubstring: 'expected').
-			seen := true ].
-	self assert: result.
-	self assert: seen
+        | parser result seen |
+        parser := $a asParser.
+        result := parser parse: 'a' onError: [ self signalFailure: 'Not supposed to report an error' ].
+        self assert: result equals: $a.
+        result := parser
+                parse: 'b'
+                onError: [ :failure | 
+                        self assert: failure position equals: 0.
+                        self assert: (failure message includesSubstring: $a printString).
+                        self assert: (failure message includesSubstring: 'expected').
+                        seen := true ].
+        self assert: result.
+        self assert: seen
+
+    "Modified: / 03-10-2014 / 23:42:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 testParseOnError2
-	| parser result seen |
-	parser := $a asParser.
-	result := parser parse: 'a' onError: [ self signalFailure: 'Not supposed to report an error' ].
-	self assert: result equals: $a.
-	result := parser
-		parse: 'b'
-		onError: [ :msg :pos | 
-			self assert: (msg includesSubstring: '$a').
-			self assert: (msg includesSubstring: 'expected').
-			self assert: pos equals: 0.
-			seen := true ].
-	self assert: result.
-	self assert: seen
+        | parser result seen |
+        parser := $a asParser.
+        result := parser parse: 'a' onError: [ self signalFailure: 'Not supposed to report an error' ].
+        self assert: result equals: $a.
+        result := parser
+                parse: 'b'
+                onError: [ :msg :pos | 
+                        self assert: (msg includesSubstring: $a printString).
+                        self assert: (msg includesSubstring: 'expected').
+                        self assert: pos equals: 0.
+                        seen := true ].
+        self assert: result.
+        self assert: seen
+
+    "Modified: / 03-10-2014 / 23:42:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 testParser