Skip to content

Commit 185d74e

Browse files
committed
Specific test for #95
1 parent b25e7e0 commit 185d74e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/interfaceTests.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,17 @@ end
181181
dfgSubgraph = getSubgraph(dfg,[:x1, :x2, :x1x2f1])
182182
# Only returns x1 and x2
183183
@test symdiff([:x1, :x1x2f1, :x2], [ls(dfgSubgraph)..., lsf(dfgSubgraph)...]) == []
184+
185+
# DFG issue #95 - confirming that getSubgraphAroundNode retains order
186+
# REF: https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues/95
187+
for fId in getVariableIds(dfg)
188+
# Get a subgraph of this and it's related factors+variables
189+
dfgSubgraph = getSubgraphAroundNode(dfg, verts[1], 2)
190+
# For each factor check that the order the copied graph == original
191+
for fact in getFactors(dfgSubgraph)
192+
@test fact._variableOrderSymbols == getFactor(dfg, fact.label)._variableOrderSymbols
193+
end
194+
end
184195
end
185196

186197
@testset "Producing Dot Files" begin

0 commit comments

Comments
 (0)