Skip to content

Commit e10c4a9

Browse files
committed
Add topk_edges tests
1 parent 6d2579f commit e10c4a9

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

test/utils.jl

+10-4
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,8 @@
6868
0.451793 0.00704976 0.0189275]
6969
g1 = rand_graph(3, 6, ndata = (x = A,))
7070
g2 = rand_graph(3, 6, ndata = B)
71-
72-
#
7371
output1 = topk_nodes(g1, :x, 2)
7472
output2 = topk_nodes(g2, :x, 1, sortby = 2)
75-
7673
@test output1 == [9.0 5.0;
7774
10.0 6.0;
7875
11.0 7.0;
@@ -88,4 +85,13 @@
8885
11.0 7.0 0.921823 0.494715;
8986
12.0 8.0 0.451793 0.0189275]
9087
end
91-
end;
88+
89+
@testset "topk_edges" begin
90+
A = [0.157163 0.561874 0.886584 0.0475203 0.72576 0.815986;
91+
0.852048 0.974619 0.0345627 0.874303 0.614322 0.113491]
92+
g1 = rand_graph(5, 6, edata = (x = A,))
93+
output1 = topk_edges(g1, :x, 2)
94+
@test output1 == [0.886584 0.815986;
95+
0.974619 0.874303]
96+
end
97+
end

0 commit comments

Comments
 (0)