Skip to content

Commit

Permalink
fix: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
askorupka committed Sep 29, 2024
1 parent 5859d3d commit 2b36121
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions GNNGraphs/test/sampling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2b36121

Please sign in to comment.