-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add generic graphs to help with testing #133
Add generic graphs to help with testing #133
Conversation
Codecov Report
@@ Coverage Diff @@
## master #133 +/- ##
==========================================
- Coverage 97.40% 97.27% -0.14%
==========================================
Files 109 110 +1
Lines 6470 6377 -93
==========================================
- Hits 6302 6203 -99
- Misses 168 174 +6 |
@etiennedeg @gdalle can I have your opinion on that? I think it is something that would be quite useful to have. |
@simonschoelly I think it's a really good idea, and it goes some of the way in clarifying interface specification. |
I also think it's good to have. |
Actually, as these wrappers should correspond correctly to the interface, using them in tests does ensure that these tests work correctly. And these wrappers will fail if one does something fishy with it, for example trying to access |
019ab5b
to
4152778
Compare
000136b
to
86b9f06
Compare
86b9f06
to
7970783
Compare
I'm in favor of merging, and I opened #224 to keep track of the transition |
Our tests currently almost everywhere use
SimpleGraph
andSimpleDiGraph
for testing methods that work withAbstractGraph
andAbstractEege
.. This can lead to issues, when the methods under test relay on methods that are defined forSimpleGraph
andSimpleDiGraph
, but are not part of the Graphs.jl interface.This PR therefore adds a submodule
Graphs.Test
and the generic graph typesGenericGraph
andGenericDiGraph
as well as the generic edge typeGenericEdge
that correspond to the interface, but nothing else. The submodule is located within thesrc
and not thetest
directory, so that it can also be used in tests of downstream packages.The names are inspired from similar structures such as
GenericArray
andGenericOrder
in the Julia packageTest.jl
.Mutability is currently not covered, as the interface is also not well defined there - this is something we have to tackle in the future.
I also added the generic types to a few existing tests to demonstrate their functionality - in the future we should also modify other tests to use them.