Skip to content

Commit 6bc6d3c

Browse files
tests
1 parent 3cc3508 commit 6bc6d3c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

test/gnngraph.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@
1717

1818
@test g.num_edges == 8
1919
@test g.num_nodes == 4
20+
@test nv(g) == g.num_nodes
21+
@test ne(g) == g.num_edges
2022
@test collect(edges(g)) |> sort == collect(zip(s, t)) |> sort
2123
@test sort(outneighbors(g, 1)) == [2, 4]
2224
@test sort(inneighbors(g, 1)) == [2, 4]
2325
@test is_directed(g) == true
2426
s1, t1 = GraphNeuralNetworks.sort_edge_index(edge_index(g))
2527
@test s1 == s
2628
@test t1 == t
29+
@test vertices(g) == 1:g.num_nodes
2730

2831
@test sort.(adjacency_list(g; dir=:in)) == adj_list_in
2932
@test sort.(adjacency_list(g; dir=:out)) == adj_list_out
@@ -119,6 +122,7 @@
119122
@test sort(outneighbors(g, 1)) == [2]
120123
@test sort(inneighbors(g, 1)) == [4]
121124
@test is_directed(g) == true
125+
@test is_directed(typeof(g)) == true
122126
s1, t1 = GraphNeuralNetworks.sort_edge_index(edge_index(g))
123127
@test s1 == s
124128
@test t1 == t

test/test_utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function FiniteDifferences.to_vec(x::Integer)
1212
return Int[x], Integer_from_vec
1313
end
1414

15-
function test_layer(l, g::GNNGraph; atol = 1e-7, rtol = 1e-5,
15+
function test_layer(l, g::GNNGraph; atol = 1e-6, rtol = 1e-5,
1616
exclude_grad_fields = [],
1717
broken_grad_fields =[],
1818
verbose = false,

0 commit comments

Comments
 (0)