From 781326827a18658097bc7509e86f4f8032a19c06 Mon Sep 17 00:00:00 2001 From: Jordan Singer Date: Mon, 9 Oct 2023 12:38:13 -0500 Subject: [PATCH] use weighted func --- paths_test.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/paths_test.go b/paths_test.go index 5c8188e..2ae8887 100644 --- a/paths_test.go +++ b/paths_test.go @@ -401,11 +401,9 @@ func TestUndirectedShortestPath(t *testing.T) { for name, test := range tests { var graph Graph[string, string] if test.isDirected { - graph = New(StringHash, Directed()) - graph.(*directed[string, string]).traits.IsWeighted = test.isWeighted + graph = New(StringHash, Directed(), Weighted()) } else { - graph = New(StringHash) - graph.(*undirected[string, string]).traits.IsWeighted = test.isWeighted + graph = New(StringHash, Weighted()) } for _, vertex := range test.vertices { @@ -574,8 +572,7 @@ func Test_BellmanFord(t *testing.T) { }, } for name, test := range tests { - graph := New(StringHash, Directed()) - graph.(*directed[string, string]).traits.IsWeighted = test.isWeighted + graph := New(StringHash, Directed(), Weighted()) for _, vertex := range test.vertices { _ = graph.AddVertex(vertex)