From 2b36121c1c4f3726db81b9d6a07d2ee8d6e991fd Mon Sep 17 00:00:00 2001 From: Agata Skorupka Date: Sun, 29 Sep 2024 21:27:03 +0200 Subject: [PATCH] fix: fix tests --- GNNGraphs/test/sampling.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/GNNGraphs/test/sampling.jl b/GNNGraphs/test/sampling.jl index 284589ee9..73eb6f800 100644 --- a/GNNGraphs/test/sampling.jl +++ b/GNNGraphs/test/sampling.jl @@ -48,17 +48,17 @@ if GRAPH_T == :coo @testset "induced_subgraph" begin # Create a simple GNNGraph with two nodes and one edge - graph = GNNGraph() # Initialize graph - add_nodes!(graph, 2) # Add 2 nodes - add_edge!(graph, 1, 2) # Add an edge from node 1 to node 2 - graph.x = rand(10, 2) # Assign random features to both nodes (10 features per node) - + s = [1] + t = [2] + ### TODO add data + graph = GNNGraph((s, t)) + # Induce subgraph on both nodes nodes = [1, 2] subgraph = induced_subgraph(graph, nodes) @test num_nodes(subgraph) == 2 # Subgraph should have 2 nodes - @test num_nodes(subgraph) == 1 # Subgraph should have 1 edge + @test num_edges(subgraph) == 1 # Subgraph should have 1 edge ### TODO @test subgraph.ndata.x == graph.x[:, nodes] # Features should match the original graph end end \ No newline at end of file