Skip to content

Commit

Permalink
Add transcript for setEcho
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPenner committed Jan 7, 2025
1 parent 15cd84c commit 4540865
Show file tree
Hide file tree
Showing 2 changed files with 389 additions and 4 deletions.
28 changes: 24 additions & 4 deletions unison-src/transcripts/idempotent/io.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,14 @@ testSeek _ =
runTest test
testSetEcho : '{io2.IO} [Result]
testSetEcho = do
a = setEcho.impl (stdHandle StdErr) true
b = setEcho.impl (stdHandle StdErr) false
match (a, b) with
(Right _, Right _) -> [ Ok "setEcho works" ]
_ -> [ Fail "setEcho failure" ]
testAppend : '{io2.IO} [Result]
testAppend _ =
test = 'let
Expand Down Expand Up @@ -352,17 +360,19 @@ testAppend _ =
⍟ These new definitions are ok to `add`:
testAppend : '{IO} [Result]
testSeek : '{IO} [Result]
testAppend : '{IO} [Result]
testSeek : '{IO} [Result]
testSetEcho : '{IO} [Result]
```

``` ucm
scratch/main> add
⍟ I've added these definitions:
testAppend : '{IO} [Result]
testSeek : '{IO} [Result]
testAppend : '{IO} [Result]
testSeek : '{IO} [Result]
testSetEcho : '{IO} [Result]
scratch/main> io.test testSeek
Expand All @@ -380,6 +390,16 @@ scratch/main> io.test testSeek
Tip: Use view 1 to view the source of a test.
scratch/main> io.test testSetEcho
New test results:
1. testSetEcho ◉ setEcho works
✅ 1 test(s) passing
Tip: Use view 1 to view the source of a test.
scratch/main> io.test testAppend
New test results:
Expand Down
Loading

0 comments on commit 4540865

Please sign in to comment.