shrub/tests/app/collections.hoon

98 lines
2.5 KiB
Plaintext
Raw Normal View History

2018-11-17 02:32:48 +03:00
/+ *test, collections
::
/= app /: /===/app/collections /!noun/
/= gall-vane /: /===/sys/vane/gall /!noun/
::
=, gall
=>
|%
++ gall-args [~1234.5.7 0vagine *slyt]
::
++ hype
|= tak=task:able:gall
^- (hypo (hobo task:able:gall))
[-:!>(tak) tak]
::
++ gall-gate (gall-vane !>(..zuse))
--
::
|%
::
++ test-prep
=/ prep-bone 20
=/ our-ship ~marzod
2019-01-18 08:37:34 +03:00
=/ bol
2018-11-17 02:32:48 +03:00
%* . *bowl:gall
our our-ship
ost prep-bone
==
::
=/ moves -:(~(prep app bol *state:collections) ~)
;: weld
%+ expect-eq
!> %- sort
:_ aor
^- (list move:collections)
2019-01-18 08:37:34 +03:00
:~ :* prep-bone %poke /col-hall-action [our-ship %hall]
2018-11-17 02:32:48 +03:00
%hall-action %create %c 'collections' %journal
==
::
2019-01-18 08:37:34 +03:00
:* prep-bone %poke /col-hall-action [our-ship %hall]
2018-11-17 02:32:48 +03:00
%hall-action %source %inbox & (sy [[our-ship %c] ~]~)
==
::
:* prep-bone %peer /circles [our-ship %hall]
/circles/[(scot %p our-ship)]
==
::
:* prep-bone %peer /inbox [our-ship %hall]
/circle/inbox/config/grams
==
::
:* prep-bone %peer /invites [our-ship %hall]
/circle/i/grams
==
==
2019-01-18 08:37:34 +03:00
!> (sort moves aor)
2018-11-17 02:32:48 +03:00
::
=. our-ship ~davtyr-nimren
=. bol bol(our our-ship)
::
=/ moves -:(~(prep app bol *state:collections) ~)
%+ expect-eq
!> %- sort
:_ aor
^- (list move:collections)
2019-01-18 08:37:34 +03:00
:~ :* prep-bone %poke /col-hall-action [our-ship %hall]
2018-11-17 02:32:48 +03:00
%hall-action %create %c 'collections' %journal
==
::
2019-01-18 08:37:34 +03:00
:* prep-bone %poke /col-hall-action [our-ship %hall]
2018-11-17 02:32:48 +03:00
%hall-action %source %inbox & (sy [[our-ship %c] ~]~)
==
::
:* prep-bone %peer /circles [our-ship %hall]
/circles/[(scot %p our-ship)]
==
::
:* prep-bone %peer /inbox [our-ship %hall]
/circle/inbox/config/grams
==
::
:* prep-bone %peer /invites [our-ship %hall]
/circle/i/grams
==
::
==
2019-01-18 08:37:34 +03:00
!> (sort moves aor)
2018-11-17 02:32:48 +03:00
==
::
::++ test-load-app
:: =/ gall-door (gall-gate gall-args)
:: =/ init (call:gall-door [/test]~ (hype %init ~marzod))
:: %+ expect-eq
2019-01-18 08:37:34 +03:00
:: !>
2018-11-17 02:32:48 +03:00
:: !>
::
--