Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[deps]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
GraphsInterfaceChecker = "3bef136c-15ff-4091-acbb-1a4aafe67608"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GraphsInterfaceChecker is not registered so this will have to be a manually installed dependency (using Pkg inside of the runtests.jl). See https://github.com/JuliaGraphs/NautyGraphs.jl/pull/25/files#diff-060d04ab60a4aa7e86bfb99aaf52194f3248724e7b254508b6e7106e354101da

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops, my comment is wrong, it seems GraphsInterfaceChecker is actually registered, you can disregard this comment

JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
LEMONGraphs = "14b1564f-c77f-4800-9e89-efd961faef7c"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LEMONGraphs is already the parent project -- it should not be added here.

Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
38 changes: 38 additions & 0 deletions test/test_interface_checker.jl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is not seen by the test runner. If you use @testset then it needs to be included in runtests.jl. We actually use TestItems.jl here to make this a bit more automated, in which case you need @testitem.

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using Test
using Graphs
using LEMONGraphs
using GraphsInterfaceChecker

# helper: make a small usable LEMON graph
function make_small_undirected()
# Example: if your package exposes LEMONGraph(n)
g = LEMONGraph(5)
add_edge!(g, 1, 2)
add_edge!(g, 2, 3)
return g
end

function make_small_directed()
gd = LEMONDiGraph(5)
add_edge!(gd, 1, 2)
add_edge!(gd, 2, 3)
return gd
end

@testset "LEMONGraphs interface checks" begin
@testset "Undirected LEMONGraph" begin
g = make_small_undirected()
check_graph_interface(g)
if hasmethod(check_mutable_graph_interface, Tuple{typeof(g)})
check_mutable_graph_interface(g)
end
Comment on lines +26 to +28
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads a bit like it was confabulated by an LLM. LLMs are useful tools, but you have to disclose their use, as that informs how to perform the review.

  • hasmethod is not particularly idiomatic piece of code -- usually one just does dispatch. In this particular case, the agent you used probably used hasmethod to ensure that the next line is never executed. That is typical of AI agents -- they write wrong code and then wrap it in an if so that the wrong code never runs
  • the symbol check_mutable_graph_interface does not exist anyway

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look at NautyGraphs for how to structure this file

end

@testset "Directed LEMONGraph" begin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can skip this for now -- let's make sure the undirected graph case works

gd = make_small_directed()
check_digraph_interface(gd)
if hasmethod(check_mutable_graph_interface, Tuple{typeof(gd)})
check_mutable_graph_interface(gd)
end
end
end
Loading