Skip to content

Commit bb88817

Browse files
authored
Merge pull request #5579 from sellout/fix-transcript-error-blocks
transcripts: Reset error state for all blocks
2 parents 8d287d6 + 8e040aa commit bb88817

File tree

3 files changed

+58
-2
lines changed

3 files changed

+58
-2
lines changed

unison-cli/src/Unison/Codebase/Transcript/Runner.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL
360360
writeIORef isHidden $ hidden infoTags
361361
writeIORef allowErrors $ expectingError infoTags
362362
writeIORef expectFailure $ hasBug infoTags
363-
writeIORef hasErrors False
364363
traverse_ (atomically . Q.enqueue cmdQueue . Just) cmds
365364
atomically . Q.enqueue cmdQueue $ Nothing
366365
Cli.returnEarlyWithoutOutput
@@ -401,6 +400,7 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL
401400
liftIO $ writeIORef isHidden Shown
402401
liftIO $ writeIORef allowErrors False
403402
liftIO $ writeIORef expectFailure False
403+
liftIO $ writeIORef hasErrors False
404404
maybe (liftIO finishTranscript) (uncurry processStanza) =<< atomically (Q.tryDequeue inputQueue)
405405

406406
awaitInput :: Cli (Either Event Input)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
``` ucm :hide
2+
scratch/main> builtins.merge lib.builtin
3+
```
4+
5+
A first `:error` block works as expected.
6+
7+
``` unison :error
8+
foo : Nat
9+
foo =
10+
1 +
11+
```
12+
13+
``` ucm :added-by-ucm
14+
Loading changes detected in scratch.u.
15+
16+
I got confused here:
17+
18+
4 |
19+
20+
I was surprised to find an end of section here.
21+
I was expecting one of these instead:
22+
23+
* bang
24+
* do
25+
* false
26+
* force
27+
* handle
28+
* if
29+
* let
30+
* newline or semicolon
31+
* quote
32+
* termLink
33+
* true
34+
* tuple
35+
* typeLink
36+
```
37+
38+
Later blocks should have their error state reset.
39+
40+
``` unison
41+
foo : Nat
42+
foo =
43+
1 + 2
44+
```
45+
46+
``` ucm :added-by-ucm
47+
Loading changes detected in scratch.u.
48+
49+
I found and typechecked these definitions in scratch.u. If you
50+
do an `add` or `update`, here's how your codebase would
51+
change:
52+
53+
⍟ These new definitions are ok to `add`:
54+
55+
foo : Nat
56+
```

unison-src/transcripts/idempotent/pattern-match-coverage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ test = cases
203203

204204
## Complete patterns with guards should be accepted
205205

206-
``` unison :error
206+
``` unison
207207
test : Optional Nat -> Nat
208208
test = cases
209209
None -> 0

0 commit comments

Comments
 (0)