From f6b8f1b193eb6fd68aac03088c6f50bded6e6f76 Mon Sep 17 00:00:00 2001 From: Will Charczuk Date: Wed, 14 Feb 2024 21:55:44 -0800 Subject: [PATCH] test tweaks; cycle detection not really working? --- link_test.go | 1 - list_util.go | 14 -------------- main_test.go | 14 ++++++++++++++ 3 files changed, 14 insertions(+), 15 deletions(-) delete mode 100644 link_test.go diff --git a/link_test.go b/link_test.go deleted file mode 100644 index b8a407a..0000000 --- a/link_test.go +++ /dev/null @@ -1 +0,0 @@ -package incr diff --git a/list_util.go b/list_util.go index c5ac573..f4d51b9 100644 --- a/list_util.go +++ b/list_util.go @@ -9,17 +9,3 @@ func remove[A INode](nodes []A, id Identifier) []A { } return output } - -func hasKey[A INode](nodes []A, id Identifier) bool { - for _, n := range nodes { - if n.Node().id == id { - return true - } - } - return false -} - -func mapHasKey[K comparable, V any](m map[K]V, k K) (ok bool) { - _, ok = m[k] - return -} diff --git a/main_test.go b/main_test.go index 55ab6bf..810c11e 100644 --- a/main_test.go +++ b/main_test.go @@ -249,3 +249,17 @@ func dumpDot(g *Graph, path string) error { } return nil } + +func hasKey[A INode](nodes []A, id Identifier) bool { + for _, n := range nodes { + if n.Node().id == id { + return true + } + } + return false +} + +func mapHasKey[K comparable, V any](m map[K]V, k K) (ok bool) { + _, ok = m[k] + return +}