Skip to content

Commit 8e040aa

Browse files
committed
transcripts: Reset error state for all blocks
Previously, once there was an `:error` (or `:bug`) block, all following blocks would behave as if they had had an error. Except `ucm` blocks would correctly reset the state so that following blocks would behave correctly again. This moves the state reset to be shared by all blocks. Fixes #5575.
1 parent c3b42f9 commit 8e040aa

File tree

3 files changed

+3
-27
lines changed

3 files changed

+3
-27
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)

unison-src/transcripts/idempotent/fix-5575.md

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,31 +35,7 @@ foo =
3535
* typeLink
3636
```
3737

38-
But later blocks all act as if they have errors, even if they don’t.
39-
40-
``` unison :bug
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-
```
57-
58-
But an intervening `ucm` block (regardless of whether it errors) will correct it.
59-
60-
``` ucm :hide
61-
scratch/main> help
62-
```
38+
Later blocks should have their error state reset.
6339

6440
``` unison
6541
foo : Nat

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)