Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transcripts: Reset error state for all blocks #5579

Merged
merged 2 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion unison-cli/src/Unison/Codebase/Transcript/Runner.hs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL
writeIORef isHidden $ hidden infoTags
writeIORef allowErrors $ expectingError infoTags
writeIORef expectFailure $ hasBug infoTags
writeIORef hasErrors False
traverse_ (atomically . Q.enqueue cmdQueue . Just) cmds
atomically . Q.enqueue cmdQueue $ Nothing
Cli.returnEarlyWithoutOutput
Expand Down Expand Up @@ -401,6 +400,7 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL
liftIO $ writeIORef isHidden Shown
liftIO $ writeIORef allowErrors False
liftIO $ writeIORef expectFailure False
liftIO $ writeIORef hasErrors False
maybe (liftIO finishTranscript) (uncurry processStanza) =<< atomically (Q.tryDequeue inputQueue)

awaitInput :: Cli (Either Event Input)
Expand Down
56 changes: 56 additions & 0 deletions unison-src/transcripts/idempotent/fix-5575.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
``` ucm :hide
scratch/main> builtins.merge lib.builtin
```

A first `:error` block works as expected.

``` unison :error
foo : Nat
foo =
1 +
```

``` ucm :added-by-ucm
Loading changes detected in scratch.u.

I got confused here:

4 |

I was surprised to find an end of section here.
I was expecting one of these instead:

* bang
* do
* false
* force
* handle
* if
* let
* newline or semicolon
* quote
* termLink
* true
* tuple
* typeLink
```

Later blocks should have their error state reset.

``` unison
foo : Nat
foo =
1 + 2
```

``` ucm :added-by-ucm
Loading changes detected in scratch.u.

I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:

⍟ These new definitions are ok to `add`:

foo : Nat
```
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ test = cases

## Complete patterns with guards should be accepted

``` unison :error
``` unison
test : Optional Nat -> Nat
test = cases
None -> 0
Expand Down
Loading