diff --git a/sys/hoon.hoon b/sys/hoon.hoon index 9ed33a1862..f9f0810ae8 100644 --- a/sys/hoon.hoon +++ b/sys/hoon.hoon @@ -1875,10 +1875,9 @@ :: ++ nap :: removes head ?> ?=(^ a) - ?~ a ~ - =+ b=get - ?~ q.b ~ - bal(a ^+(a [n=n.q.b l=l.q.b r=r.q.b])) + ?: =(~ l.a) r.a + =+ b=get(a l.a) + bal(a ^+(a [p.b q.b r.a])) :: ++ put :: insert new tail |* b/* diff --git a/tests/sys/hoon/qeu.hoon b/tests/sys/hoon/qeu.hoon deleted file mode 100644 index b52b4bf0b9..0000000000 --- a/tests/sys/hoon/qeu.hoon +++ /dev/null @@ -1,51 +0,0 @@ -:: test a fix for a bug in +nap:to affecting three-item queues. -:: -:: (see https://github.com/urbit/arvo/issues/1100 for details) -:: -:: the test creates several queues from known lists and recursively -:: unqueues the top, comparing it with the current element of the list. -:: -/+ *test -:: -=/ descending ~[7 6 5 4 3 2 1] -=/ ascending ~[1 2 3 4 5 6 7] -=/ unsorted ~[1 6 3 5 7 2 4] -=/ duplicates ~[1 1 7 4 6 9 4] -:: -=> -|% -++ unqueue - |= [queue=(qeu @) test=(list @)] - ^- tang - %- zing - |- ^- (list tang) - ?~ test ~ - ?~ queue ~ - :_ $(queue ~(nap to queue), test t.test) - %+ expect-eq - !> (need ~(top to queue)) - !> i.test --- -:: -|% -:: -++ test-descending-sorted-list ^- tang - :: - =+ queue=(~(gas to `(qeu @)`~) descending) - (unqueue [queue descending]) -:: -++ test-ascending-sorted-list ^- tang - :: - =+ queue=(~(gas to `(qeu @)`~) ascending) - (unqueue [queue ascending]) -:: -++ test-unsorted-list ^- tang - :: - =+ queue=(~(gas to `(qeu @)`~) unsorted) - (unqueue [queue unsorted]) -:: -++ test-duplicates-list ^- tang - :: - =+ queue=(~(gas to `(qeu @)`~) duplicates) - (unqueue [queue duplicates]) ---