unison/unison-src/transcripts/move-all.md

72 lines
971 B
Markdown
Raw Permalink Normal View History

2023-12-01 01:03:42 +03:00
# Tests for `move`
```ucm:hide
scratch/main> builtins.merge
2023-12-01 01:03:42 +03:00
```
## Happy Path - namespace, term, and type
Create a term, type, and namespace with history
```unison
Foo = 2
unique type Foo = Foo
Foo.termInA = 1
unique type Foo.T = T
```
```ucm
scratch/main> add
2023-12-01 01:03:42 +03:00
```
```unison
Foo.termInA = 2
unique type Foo.T = T1 | T2
```
```ucm
scratch/main> update
2023-12-01 01:03:42 +03:00
```
Should be able to move the term, type, and namespace, including its types, terms, and sub-namespaces.
```ucm
scratch/main> move Foo Bar
scratch/main> ls
scratch/main> ls Bar
scratch/main> history Bar
2023-12-01 01:03:42 +03:00
```
## Happy Path - Just term
```unison
bonk = 5
```
```ucm
2024-06-12 01:31:09 +03:00
z/main> builtins.merge
z/main> add
z/main> move bonk zonk
z/main> ls
2023-12-01 01:03:42 +03:00
```
## Happy Path - Just namespace
```unison
bonk.zonk = 5
```
```ucm
2024-06-12 01:31:09 +03:00
a/main> builtins.merge
a/main> add
a/main> move bonk zonk
a/main> ls
a/main> view zonk.zonk
2023-12-01 01:03:42 +03:00
```
## Sad Path - No term, type, or namespace named src
```ucm:error
scratch/main> move doesntexist foo
2023-12-01 01:03:42 +03:00
```