Minor fixes in tests for Smalltalk/X
authorJan Vrany <jan.vrany@fit.cvut.cz>
Sat, 08 Nov 2014 01:03:21 +0000
changeset 418 b3080b20b14c
parent 417 3c0a91182e65
child 419 5c502ab8e87d
Minor fixes in tests for Smalltalk/X * Do now show `Transcript crShow: '...'` but more portable `Transcript show:'...'; cr`
compiler/tests/PPCOptimizingTest.st
compiler/tests/PPCompiledSmalltalkGrammarResource.st
--- a/compiler/tests/PPCOptimizingTest.st	Fri Nov 07 02:14:26 2014 +0000
+++ b/compiler/tests/PPCOptimizingTest.st	Sat Nov 08 01:03:21 2014 +0000
@@ -7,6 +7,7 @@
 	category:'PetitCompiler-Tests-Nodes'
 !
 
+
 !PPCOptimizingTest methodsFor:'test support'!
 
 assert: object type: class
@@ -115,11 +116,20 @@
 !
 
 testInlinePluggable
-	| tree |
-	tree := self optimize: [:ctx | nil] asParser star.
+        | tree |
+        tree := self optimize: [:ctx | nil] asParser star.
 
-	self assert: tree type: PPCStarNode.
-	self assert: tree child type: PPCInlinePluggableNode.
+        self assert: tree type: PPCStarNode.
+        "Sadly, on Smalltalk/X blocks cannot be inlined because
+         the VM does not provide enough information to map
+         it back to source code. Very bad indeed!!"
+        ((Smalltalk respondsTo:#isSmalltalkX) and:[ Smalltalk isSmalltalkX ]) ifTrue:[
+                self assert: tree child type: PPCPluggableNode.
+        ] ifFalse:[ 
+                self assert: tree child type: PPCInlinePluggableNode.
+        ]
+
+    "Modified: / 08-11-2014 / 00:57:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 testInlinePredicate
@@ -252,3 +262,10 @@
 	self assert: tree child child type: PPCInlineCharacterNode.
 ! !
 
+!PPCOptimizingTest class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- a/compiler/tests/PPCompiledSmalltalkGrammarResource.st	Fri Nov 07 02:14:26 2014 +0000
+++ b/compiler/tests/PPCompiledSmalltalkGrammarResource.st	Sat Nov 08 01:03:21 2014 +0000
@@ -10,11 +10,12 @@
 !PPCompiledSmalltalkGrammarResource methodsFor:'as yet unclassified'!
 
 setUp
-	| time |
-	time := Time millisecondsToRun: [
-	PPSmalltalkGrammar new compile: #PPCompiledSmalltalkGrammar
-	].
-	Transcript crShow: 'Grammar compiled in: ', time asString, 'ms'.
-	
+        | time |
+        time := Time millisecondsToRun: [
+        PPSmalltalkGrammar new compile: #PPCompiledSmalltalkGrammar
+        ].
+        Transcript show: 'Grammar compiled in: ', time asString, 'ms'; cr.
+
+    "Modified: / 08-11-2014 / 00:54:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !