fix(lib): swapped entries in test dag.sort.topological."sorts a graph" #9

Merged
jakehamilton merged 1 commit from austreelis/fix/lib-test-dag-sort-topo-failure into main 2024-10-08 18:44:31 +00:00
Contributor

I figure it's a simple typo. This test expects entries "a", "b", "c", "d" to be lexicographically sorted but fails. The actual result is that entries are sorted in this order: c, b, a, d. This is because the test adds the entry "b" = lib.dag.entry.between [ "c" ] [ "a" ] "b", i.e. after "c" and before "a". I haven't checked if it was a logic error in the sort implementation, as other pieces of labs rely on it (and use lib.dag.entry.between with the arguments flipped relative to the test, which makes sense), and the arguments of the function lib.dag.entry.between are named "after", then "before".

I figure it's a simple typo. This test expects entries `"a"`, `"b"`, `"c"`, `"d"` to be lexicographically sorted but fails. The actual result is that entries are sorted in this order: `c, b, a, d`. This is because the test adds the entry `"b" = lib.dag.entry.between [ "c" ] [ "a" ] "b"`, i.e. after `"c"` and before `"a"`. I haven't checked if it was a logic error in the sort implementation, as other pieces of labs rely on it (and use `lib.dag.entry.between` with the arguments flipped relative to the test, which makes sense), and the arguments of the function `lib.dag.entry.between` are named "after", *then* "before".
austreelis added 1 commit 2024-09-18 15:43:36 +00:00
Owner

Ah good catch! Thank you!

Ah good catch! Thank you!
jakehamilton approved these changes 2024-09-22 02:55:25 +00:00
jakehamilton merged commit 866b8902c9 into main 2024-10-08 18:44:31 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: auxolotl/labs#9
No description provided.