From 866b8902c975a1aaec547445976dd39d60def4ab Mon Sep 17 00:00:00 2001
From: Austreelis <austreelis@noreply.git.auxolotl.org>
Date: Tue, 8 Oct 2024 18:44:31 +0000
Subject: [PATCH] fix(lib): swapped entries in test dag.sort.topological."sorts
 a graph" (#9)

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".

Co-authored-by: Austreelis <dev.austreelis@swhaele.net>
Reviewed-on: https://git.auxolotl.org/auxolotl/labs/pulls/9
Reviewed-by: Jake Hamilton <jake.hamilton@hey.com>
Co-authored-by: Austreelis <austreelis@noreply.git.auxolotl.org>
Co-committed-by: Austreelis <austreelis@noreply.git.auxolotl.org>
---
 lib/src/dag/default.test.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/src/dag/default.test.nix b/lib/src/dag/default.test.nix
index 5c13cd9..62453e0 100644
--- a/lib/src/dag/default.test.nix
+++ b/lib/src/dag/default.test.nix
@@ -149,7 +149,7 @@ in
           ];
           actual = lib.dag.sort.topological {
             a = lib.dag.entry.anywhere "a";
-            b = lib.dag.entry.between [ "c" ] [ "a" ] "b";
+            b = lib.dag.entry.between [ "a" ] [ "c" ] "b";
             c = lib.dag.entry.before [ "c" ] "c";
             d = lib.dag.entry.after [ "c" ] "d";
           };