unison/unison-src/transcripts/fix942.output.md

126 lines
2.0 KiB
Markdown
Raw Permalink Normal View History

First we add some code:
``` unison
x = 0
y = x + 1
z = y + 2
```
``` 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`:
x : Nat
y : Nat
z : Nat
```
``` ucm
scratch/main> add
⍟ I've added these definitions:
x : Nat
y : Nat
z : Nat
```
Now we edit `x` to be `7`, which should make `z` equal `10`:
``` unison
x = 7
```
``` 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 names already exist. You can `update` them to your
new definition:
x : Nat
```
``` ucm
scratch/main> update
2023-11-14 06:36:03 +03:00
Okay, I'm searching the branch for code that needs to be
updated...
That's done. Now I'm making sure everything typechecks...
Everything typechecks, so I'm saving the results...
2023-11-08 19:54:50 +03:00
Done.
scratch/main> view x y z
x : Nat
x = 7
y : Nat
y =
use Nat +
x + 1
z : Nat
z =
use Nat +
y + 2
```
Uh oh\! `z` is still referencing the old version. Just to confirm:
``` unison
test> t1 = if z == 3 then [Fail "nooo!!!"] else [Ok "great"]
```
``` 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`:
t1 : [Result]
2020-04-08 21:25:19 +03:00
Now evaluating any watch expressions (lines starting with
`>`)... Ctrl+C cancels.
1 | test> t1 = if z == 3 then [Fail "nooo!!!"] else [Ok "great"]
✅ Passed great
```
``` ucm
scratch/main> add
⍟ I've added these definitions:
t1 : [Result]
scratch/main> test
Cached test results (`help testcache` to learn more)
1. t1 ◉ great
✅ 1 test(s) passing
2024-06-26 23:01:36 +03:00
Tip: Use view 1 to view the source of a test.
```