#QUALITY by cg
class: RegressionTests::OperatingSystemTest
changed: #test01_environmentVariables
--- a/RegressionTests__OperatingSystemTest.st Wed Jul 26 12:07:41 2017 +0200
+++ b/RegressionTests__OperatingSystemTest.st Wed Jul 26 12:11:27 2017 +0200
@@ -113,12 +113,16 @@
test01_environmentVariables
|batchFile output
- expected50 expected101 expected203 expected407 expected815 expected1631 expected3263|
+ expected50 expected101 expected203 expected407 expected815 expected1631 expected3263
+ expected6527 expected13055 expected26111|
self
skipIf:(OperatingSystem isMSWINDOWSlike not)
description:'This test is only for the Windows platform'.
+ "/ creates a batch file and starts another stx inside it, which retrieves a previously
+ "/ set environment variable...
+
"/ reading env-var
batchFile := 'test.bat' asFilename.
@@ -173,7 +177,7 @@
self assert:(output = expected1631).
- "/ reading a longer env-var (1631 chars)
+ "/ reading a longer env-var (3263 chars)
batchFile := 'test.bat' asFilename.
batchFile contents:'@set V50=12345678901234567890123456789012345678901234567890
@@ -201,6 +205,40 @@
self assert:(output = expected3263).
+ "/ reading a very long env-var (3263 chars)
+
+ 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%
+@set V13055=%V6527%;%V6527%
+@set V26111=%V13055%;%V13055%
+@stx --eval "Stdout nextPutAll:(OperatingSystem getEnvironment:''V26111'') "
+'.
+
+ output :=
+ String streamContents:[:out |
+ OperatingSystem executeCommand:'test.bat' outputTo:out.
+ ].
+
+ expected50 := '12345678901234567890123456789012345678901234567890'.
+ expected101 := expected50,';',expected50.
+ expected203 := expected101,';',expected101.
+ expected407 := expected203,';',expected203.
+ expected815 := expected407,';',expected407.
+ expected1631 := expected815,';',expected815.
+ expected3263 := expected1631,';',expected1631.
+ expected6527 := expected3263,';',expected3263.
+ expected13055 := expected6527,';',expected6527.
+ expected26111 := expected13055,';',expected13055.
+
+ self assert:(output = expected26111).
+
"
self new test01_environmentVariables
"