From 178ca5e8a33ee97c7e1baeb749532b716a5d056a Mon Sep 17 00:00:00 2001 From: Fang Date: Thu, 21 Mar 2019 12:45:28 +0100 Subject: [PATCH 1/4] Print selected audience more compactly If there is a bound glyph for a target, instead of showing both the glyph and the target, show just the glyph. --- app/talk.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/talk.hoon b/app/talk.hoon index 7c1b2c5b7..3bfcc8ef1 100644 --- a/app/talk.hoon +++ b/app/talk.hoon @@ -2098,7 +2098,7 @@ :: render circle (as glyph if we can). ?~ moy =+ cha=(~(get by bound) one ~ ~) - =- ?~(cha - "{u.cha ~} {-}") + =- ?~(cha - "{u.cha ~}") ~(cr-phat cr one) (~(cr-curt cr one) u.moy) -- From 397dd6df81ec3065052feb9f79e0714e02b05edb Mon Sep 17 00:00:00 2001 From: "Jose L. Bellod Cisneros" Date: Sat, 30 Mar 2019 18:53:05 +0100 Subject: [PATCH 2/4] fixes a bug in +nap:to affecting three-item queues --- sys/hoon.hoon | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/hoon.hoon b/sys/hoon.hoon index 863938cad..5d72eaa72 100644 --- a/sys/hoon.hoon +++ b/sys/hoon.hoon @@ -1875,9 +1875,10 @@ :: ++ nap :: removes head ?> ?=(^ a) - ?: =(~ l.a) r.a - =+ b=get(a l.a) - bal(a ^+(a [p.b q.b r.a])) + ?~ a ~ + =+ b=get + ?~ q.b ~ + bal(a ^+(a [n=n.q.b l=l.q.b r=r.q.b])) :: ++ put :: insert new tail |* b/* From 697a69ff4b16d00f2bea729306314d0c46e3df38 Mon Sep 17 00:00:00 2001 From: "Jose L. Bellod Cisneros" Date: Sat, 30 Mar 2019 19:51:02 +0100 Subject: [PATCH 3/4] unit tests for +qeu fix --- tests/sys/hoon/qeu.hoon | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tests/sys/hoon/qeu.hoon diff --git a/tests/sys/hoon/qeu.hoon b/tests/sys/hoon/qeu.hoon new file mode 100644 index 000000000..5e47f905c --- /dev/null +++ b/tests/sys/hoon/qeu.hoon @@ -0,0 +1,50 @@ +:: 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 @)] + %- 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) + ;:(welp (unqueue [queue descending])) +:: +++ test-ascending-sorted-list ^- tang + :: + =+ queue=(~(gas to `(qeu @)`~) ascending) + ;:(welp (unqueue [queue ascending])) +:: +++ test-unsorted-list ^- tang + :: + =+ queue=(~(gas to `(qeu @)`~) unsorted) + ;:(welp (unqueue [queue unsorted])) +:: +++ test-duplicates-list ^- tang + :: + =+ queue=(~(gas to `(qeu @)`~) duplicates) + ;:(welp (unqueue [queue duplicates])) +-- From 346aa84536fcc5594e5fde3996dc7e729a32a97a Mon Sep 17 00:00:00 2001 From: "Jose L. Bellod Cisneros" Date: Sun, 31 Mar 2019 07:16:36 +0200 Subject: [PATCH 4/4] removes unnecessary welps --- tests/sys/hoon/qeu.hoon | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/sys/hoon/qeu.hoon b/tests/sys/hoon/qeu.hoon index 5e47f905c..b52b4bf0b 100644 --- a/tests/sys/hoon/qeu.hoon +++ b/tests/sys/hoon/qeu.hoon @@ -16,6 +16,7 @@ |% ++ unqueue |= [queue=(qeu @) test=(list @)] + ^- tang %- zing |- ^- (list tang) ?~ test ~ @@ -31,20 +32,20 @@ ++ test-descending-sorted-list ^- tang :: =+ queue=(~(gas to `(qeu @)`~) descending) - ;:(welp (unqueue [queue descending])) + (unqueue [queue descending]) :: ++ test-ascending-sorted-list ^- tang :: =+ queue=(~(gas to `(qeu @)`~) ascending) - ;:(welp (unqueue [queue ascending])) + (unqueue [queue ascending]) :: ++ test-unsorted-list ^- tang :: =+ queue=(~(gas to `(qeu @)`~) unsorted) - ;:(welp (unqueue [queue unsorted])) + (unqueue [queue unsorted]) :: ++ test-duplicates-list ^- tang :: =+ queue=(~(gas to `(qeu @)`~) duplicates) - ;:(welp (unqueue [queue duplicates])) + (unqueue [queue duplicates]) --