naive: combine l2 spawn tests

This commit is contained in:
drbeefsupreme 2021-05-06 11:37:02 -04:00
parent f39ca44a9d
commit 0266805b12
No known key found for this signature in database
GPG Key ID: B70D5683DE7F9EFC

View File

@ -522,30 +522,32 @@
dominion:(~(got by points.state) ~dopbud)
::
++ test-marbud-l2-spawn ^- tang
=/ lt-ospawn [~marbud %marbud-key-0 %own ~linnup-torsyx (addr %ll-key-0)]
=/ marbud-sproxy [~marbud %marbud-key-0 %own (addr %marbud-skey)]
=/ lt-ospawn [~marbud %marbud-key-0 %own ~linnup-torsyx (addr %lt-key-0)]
=/ lt-sspawn [~marbud %marbud-skey %spawn ~linnup-torsyx (addr %lt-key-0)]
::
;: weld
%+ expect-eq
!> [`@ux`(addr %ll-key-0) 0]
:: Tests l2 spawning with ownership
!> [`@ux`(addr %lt-key-0) 0]
::
!>
=| =^state:naive
=^ f state (init-marbud state)
=^ f state (n state %bat q:(spawn:l2 0 lt-ospawn))
transfer-proxy.own:(~(got by points.state) ~linnup-torsyx)
::
++ test-marbud-l2-spawn-w-proxy ^- tang
=/ marbud-sproxy [~marbud %marbud-key-0 %own (addr %marbud-skey)]
=/ lt-ospawn [~marbud %marbud-skey %spawn ~linnup-torsyx (addr %lt-key-0)]
::
%+ expect-eq
:: Tests l2 spawning with spawn proxy
!> [`@ux`(addr %lt-key-0) 0]
::
!>
=| =^state:naive
=^ f state (init-marbud state)
=^ f state (n state %bat q:(set-spawn-proxy:l2 0 marbud-sproxy))
=^ f state (n state %bat q:(spawn:l2 0 lt-ospawn))
=^ f state (n state %bat q:(spawn:l2 0 lt-sspawn))
transfer-proxy.own:(~(got by points.state) ~linnup-torsyx)
==
::
++ test-marbud-l2-double-spawn ^- tang
:: Attempts to spawn the same planet twice, once with ownership and once with spawn proxy