*** empty log message ***
authorsr
Mon, 18 Sep 2017 14:02:30 +0200
changeset 1704 ca79c2585edf
parent 1703 1d4f44ef3cc9
child 1705 5a2511181460
*** empty log message ***
RegressionTests__OperatingSystemTest.st
--- a/RegressionTests__OperatingSystemTest.st	Mon Sep 18 11:59:28 2017 +0200
+++ b/RegressionTests__OperatingSystemTest.st	Mon Sep 18 14:02:30 2017 +0200
@@ -112,7 +112,7 @@
 !OperatingSystemTest methodsFor:'tests'!
 
 test01_environmentVariables
-    |batchFile output
+    |cr content batchFile output 
      expected50 expected101 expected203 expected407 expected815 expected1631 expected3263
      expected6527|
 
@@ -120,15 +120,18 @@
         skipIf:(OperatingSystem isMSWINDOWSlike not)
         description:'This test is only for the Windows platform'.
 
+	cr := Character cr asString.
+	
     "/ creates a batch file and starts another stx inside it, which retrieves a previously
     "/ set environment variable...
-
     "/ reading env-var
-
+	content := 
+		'@set FOO=hello', cr,
+		('@"%1" --eval "Stdout nextPutAll:(OperatingSystem getEnvironment:''FOO'') "'
+			bindWith:OperatingSystem pathOfSTXExecutable).
+			
     batchFile := 'test.bat' asFilename.
-    batchFile contents:'@set FOO=hello
-@stx --eval "Stdout nextPutAll:(OperatingSystem getEnvironment:''FOO'') "
-'.
+    batchFile contents:content.
 
     output := 
         String streamContents:[:out |
@@ -137,13 +140,16 @@
 
     self assert:(output = 'hello').
 
+	
     "/ reading a longer env-var (50 chars)
-
+	content := 
+		'@set FOO=12345678901234567890123456789012345678901234567890', cr,
+		('@"%1" --eval "Stdout nextPutAll:(OperatingSystem getEnvironment:''FOO'') "'
+			bindWith:OperatingSystem pathOfSTXExecutable).
+		
     batchFile := 'test.bat' asFilename.
-    batchFile contents:'@set FOO=12345678901234567890123456789012345678901234567890
-@stx --eval "Stdout nextPutAll:(OperatingSystem getEnvironment:''FOO'') "
-'.
-
+    batchFile contents:content.
+			
     output := 
         String streamContents:[:out |
             OperatingSystem executeCommand:'test.bat' outputTo:out.
@@ -151,18 +157,21 @@
 
     self assert:(output = '12345678901234567890123456789012345678901234567890').
 
+	
     "/ reading a longer env-var (1631 chars)
+	content := 
+		'@set V50=12345678901234567890123456789012345678901234567890', cr,
+		'@set V101=%V50%;%V50%', cr,
+		'@set V203=%V101%;%V101%', cr,
+		'@set V407=%V203%;%V203%', cr,
+		'@set V815=%V407%;%V407%', cr,
+		'@set V1631=%V815%;%V815%', cr,
+		('@"%1" --eval "Stdout nextPutAll:(OperatingSystem getEnvironment:''V1631'') "'
+			bindWith:OperatingSystem pathOfSTXExecutable).
 
     batchFile := 'test.bat' asFilename.
-    batchFile contents:'@set V50=12345678901234567890123456789012345678901234567890
-@set V101=%V50%;%V50%
-@set V203=%V101%;%V101%
-@set V407=%V203%;%V203%
-@set V815=%V407%;%V407%
-@set V1631=%V815%;%V815%
-@stx --eval "Stdout nextPutAll:(OperatingSystem getEnvironment:''V1631'') "
-'.
-
+    batchFile contents:content.
+	
     output := 
         String streamContents:[:out |
             OperatingSystem executeCommand:'test.bat' outputTo:out.
@@ -177,18 +186,21 @@
 
     self assert:(output = expected1631).
 
+	
     "/ reading a longer env-var (3263 chars)
-
+	content := 
+		'@set V50=12345678901234567890123456789012345678901234567890', cr,
+		'@set V101=%V50%;%V50%', cr,
+		'@set V203=%V101%;%V101%', cr,
+		'@set V407=%V203%;%V203%', cr,
+		'@set V815=%V407%;%V407%', cr,
+		'@set V1631=%V815%;%V815%', cr,
+		'@set V3263=%V1631%;%V1631%', cr,
+		('@"%1" --eval "Stdout nextPutAll:(OperatingSystem getEnvironment:''V3263'') "'
+			bindWith:OperatingSystem pathOfSTXExecutable).
+			
     batchFile := 'test.bat' asFilename.
-    batchFile contents:'@set V50=12345678901234567890123456789012345678901234567890
-@set V101=%V50%;%V50%
-@set V203=%V101%;%V101%
-@set V407=%V203%;%V203%
-@set V815=%V407%;%V407%
-@set V1631=%V815%;%V815%
-@set V3263=%V1631%;%V1631%
-@stx --eval "Stdout nextPutAll:(OperatingSystem getEnvironment:''V3263'') "
-'.
+    batchFile contents:content.
 
     output := 
         String streamContents:[:out |
@@ -205,19 +217,22 @@
 
     self assert:(output = expected3263).
 
-    "/ reading a very long env-var (3263 chars)
+	
+    "/ reading a very long env-var (6527 chars)
+	content := 
+		'@set V50=12345678901234567890123456789012345678901234567890', cr,
+		'@set V101=%V50%;%V50%', cr,
+		'@set V203=%V101%;%V101%', cr,
+		'@set V407=%V203%;%V203%', cr,
+		'@set V815=%V407%;%V407%', cr,
+		'@set V1631=%V815%;%V815%', cr,
+		'@set V3263=%V1631%;%V1631%', cr,
+		'@set V6527=%V3263%;%V3263%', cr,
+		('@"%1" --eval "Stdout nextPutAll:(OperatingSystem getEnvironment:''V6527'') "'
+			bindWith:OperatingSystem pathOfSTXExecutable).
 
     batchFile := 'test.bat' asFilename.
-    batchFile contents:'@set V50=12345678901234567890123456789012345678901234567890
-@set V101=%V50%;%V50%
-@set V203=%V101%;%V101%
-@set V407=%V203%;%V203%
-@set V815=%V407%;%V407%
-@set V1631=%V815%;%V815%
-@set V3263=%V1631%;%V1631%
-@set V6527=%V3263%;%V3263%
-@stx --eval "Stdout nextPutAll:(OperatingSystem getEnvironment:''V6527'') "
-'.
+    batchFile contents:content.
 
     output := 
         String streamContents:[:out |