This repository has been archived by the owner on Aug 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1132 from urbit/hotfix
Hotfix
- Loading branch information
Showing
3 changed files
with
56 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
:: 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]) | ||
-- |