Fix transcripts/io.md to work on windows builds. (#2942)

* Use PATH so this test works on windows systems

* Update transcript output
This commit is contained in:
Chris Penner 2022-02-23 13:43:17 -06:00 committed by GitHub
parent 9978a50d64
commit 9e9ec0f5fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 14 deletions

View File

@ -258,11 +258,11 @@ testDirContents _ =
### Read environment variables
```unison:hide
testHomeEnvVar : '{io2.IO} [Result]
testHomeEnvVar _ =
testGetEnv : '{io2.IO} [Result]
testGetEnv _ =
test = 'let
home = reraise (getEnv.impl "HOME")
check "HOME environent variable should be set" (size home > 0)
path = reraise (getEnv.impl "PATH") -- PATH exists on windows, mac and linux.
check "PATH environent variable should be set" (size path > 0)
match getEnv.impl "DOESNTEXIST" with
Right _ -> emit (Fail "env var shouldn't exist")
Left _ -> emit (Ok "DOESNTEXIST didn't exist")
@ -270,7 +270,7 @@ testHomeEnvVar _ =
```
```ucm
.> add
.> io.test testHomeEnvVar
.> io.test testGetEnv
```
### Read command line args

View File

@ -414,11 +414,11 @@ testDirContents _ =
### Read environment variables
```unison
testHomeEnvVar : '{io2.IO} [Result]
testHomeEnvVar _ =
testGetEnv : '{io2.IO} [Result]
testGetEnv _ =
test = 'let
home = reraise (getEnv.impl "HOME")
check "HOME environent variable should be set" (size home > 0)
path = reraise (getEnv.impl "PATH") -- PATH exists on windows, mac and linux.
check "PATH environent variable should be set" (size path > 0)
match getEnv.impl "DOESNTEXIST" with
Right _ -> emit (Fail "env var shouldn't exist")
Left _ -> emit (Ok "DOESNTEXIST didn't exist")
@ -430,18 +430,18 @@ testHomeEnvVar _ =
⍟ I've added these definitions:
testHomeEnvVar : '{IO} [Result]
testGetEnv : '{IO} [Result]
.> io.test testHomeEnvVar
.> io.test testGetEnv
New test results:
◉ testHomeEnvVar HOME environent variable should be set
◉ testHomeEnvVar DOESNTEXIST didn't exist
◉ testGetEnv PATH environent variable should be set
◉ testGetEnv DOESNTEXIST didn't exist
✅ 2 test(s) passing
Tip: Use view testHomeEnvVar to view the source of a test.
Tip: Use view testGetEnv to view the source of a test.
```
### Read command line args