mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-20 23:07:13 +03:00
2.8 KiB
2.8 KiB
Tests for move
Happy Path - namespace, term, and type
Create a term, type, and namespace with history
Foo = 2
unique type Foo = Foo
Foo.termInA = 1
unique type Foo.T = T
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`:
unique type Foo
unique type Foo.T
Foo : Nat
Foo.termInA : Nat
.> add
⍟ I've added these definitions:
unique type Foo
unique type Foo.T
Foo : Nat
Foo.termInA : Nat
Foo.termInA = 2
unique type Foo.T = T1 | T2
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:
unique type Foo.T
Foo.termInA : Nat
(also named Foo)
.> update
Okay, I'm searching the branch for code that needs to be
updated...
Done.
Should be able to move the term, type, and namespace, including its types, terms, and sub-namespaces.
.> move Foo Bar
Done.
.> ls
1. Bar (Nat)
2. Bar (type)
3. Bar/ (4 terms, 1 type)
4. builtin/ (625 terms, 88 types)
.> ls Bar
1. Foo (Bar)
2. T (type)
3. T/ (2 terms)
4. termInA (Nat)
.> history Bar
Note: The most recent namespace hash is immediately below this
message.
⊙ 1. #o7vuviel4c
+ Adds / updates:
T T.T1 T.T2 termInA
- Deletes:
T.T
□ 2. #c5cggiaumo (start of history)
Happy Path - Just term
bonk = 5
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`:
bonk : Nat
☝️ The namespace .z is empty.
.z> add
⍟ I've added these definitions:
bonk : Nat
.z> move bonk zonk
Done.
.z> ls
1. zonk (##Nat)
Happy Path - Just namespace
bonk.zonk = 5
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`:
bonk.zonk : Nat
(also named zonk)
☝️ The namespace .a is empty.
.a> add
⍟ I've added these definitions:
bonk.zonk : Nat
.a> move bonk zonk
Done.
.a> ls
1. zonk/ (1 term)
.a> view zonk.zonk
zonk.zonk : Nat
zonk.zonk = 5
Sad Path - No term, type, or namespace named src
.> move doesntexist foo
⚠️
There is no term, type, or namespace at doesntexist.