mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-22 22:31:30 +03:00
d2964581da
Per yosoyubik's commentary in urbit/urbit#1799: The test is expecting that qeu to not be correct.. when it is. The test [98 [97 ~ ~] [100 ~ [99 ~ ~]]] is a correct queue if we look at vertical ordering: (mor 98 97), (mor 98 100) & (mor 100 99) all return %.y, so vertical ordering is correct. The previous implementation of +apt:to checked only horizontal ordering between siblings, in this case that would fail: (mor 97 100) returns %.n, but that is not how you check correctness of hoon treaps. The solution is to modify that test with a proper "incorrect" +qeu, for example: ((soft (qeu)) [97 [98 ~ ~] [100 ~ [99 ~ ~]]]). Vertical ordering is not correct with any of the children.
36 lines
659 B
Plaintext
36 lines
659 B
Plaintext
/+ *test
|
|
|%
|
|
++ test-set
|
|
;: weld
|
|
%+ expect-eq
|
|
!> (some (sy 1 2 ~))
|
|
!> ((soft (set)) [2 [1 ~ ~] ~])
|
|
::
|
|
%+ expect-eq
|
|
!> ~
|
|
!> ((soft (set)) [2 ~ [1 ~ ~]])
|
|
==
|
|
::
|
|
++ test-map
|
|
;: weld
|
|
%+ expect-eq
|
|
!> (some (my [1 2] [3 4] ~))
|
|
!> ((soft (map)) [[1 2] ~ [[3 4] ~ ~]])
|
|
::
|
|
%+ expect-eq
|
|
!> ~
|
|
!> ((soft (map)) [[1 2] [[3 4] ~ ~] ~])
|
|
==
|
|
::
|
|
++ test-qeu
|
|
;: weld
|
|
%+ expect-eq
|
|
!> (some (~(gas to *(qeu)) "abcd"))
|
|
!> ((soft (qeu)) [98 [100 ~ [99 ~ ~]] [97 ~ ~]])
|
|
::
|
|
%+ expect-eq
|
|
!> ~
|
|
!> ((soft (qeu)) [97 [98 ~ ~] [100 ~ [99 ~ ~]]])
|
|
==
|
|
--
|