mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-17 13:27:30 +03:00
2.0 KiB
2.0 KiB
Tests for move.namespace
Moving the Root
I should be able to move the root into a sub-namespace
foo = 1
.> add
-- Should request confirmation
.> move.namespace . .root.at.path
.> move.namespace . .root.at.path
.> ls
.> history
.> ls .root.at.path
.> history .root.at.path
I should be able to move a sub namespace over the root.
-- Should request confirmation
.> move.namespace .root.at.path .
.> move.namespace .root.at.path .
.> ls
.> history
-- should be empty
.> ls .root.at.path
.> history .root.at.path
scratch/happy> builtins.merge lib.builtins
Happy path
Create a namespace and add some history to it
a.termInA = 1
unique type a.T = T
scratch/happy> add
a.termInA = 2
unique type a.T = T1 | T2
scratch/happy> update
Should be able to move the namespace, including its types, terms, and sub-namespaces.
scratch/happy> move.namespace a b
scratch/happy> ls b
scratch/happy> history b
Namespace history
scratch/history> builtins.merge lib.builtins
Create some namespaces and add some history to them
a.termInA = 1
b.termInB = 10
scratch/history> add
a.termInA = 2
b.termInB = 11
scratch/history> update
Deleting a namespace should not leave behind any history, if we move another to that location we expect the history to simply be the history of the moved namespace.
scratch/history> delete.namespace b
scratch/history> move.namespace a b
-- Should be the history from 'a'
scratch/history> history b
-- Should be empty
scratch/history> history a
Moving over an existing branch
scratch/existing> builtins.merge lib.builtins
Create some namespace and add some history to them
a.termInA = 1
b.termInB = 10
scratch/existing> add
a.termInA = 2
b.termInB = 11
scratch/existing> update
scratch/existing> move.namespace a b