Skip to content

Commit d1950a3

Browse files
authored
fix CI: isdefined -> isassigned and add Dependabot (#120)
* fix: use isassigned for dijkstra_states slot checks Julia 1.11+ changed isdefined(::Vector, i) to only check bounds, not element initialization (Vectors now back onto Memory{T}). Use isassigned to preserve the original "is this slot populated?" semantics. Without this, osm_subgraph populated osg.dijkstra_states even when g had all undef entries, causing UndefRefError when comparing in tests. * chore: add dependabot for github-actions Weekly grouped updates so all action bumps land in one PR.
1 parent e042fe7 commit d1950a3

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
groups:
8+
github-actions:
9+
patterns:
10+
- "*"

src/subgraph.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function osm_subgraph(g::OSMGraph{U, T, W},
4141
add_graph!(osg, get_graph_type(g))
4242
add_node_tags!(osg)
4343

44-
if isdefined(g.dijkstra_states, 1)
44+
if !isnothing(g.dijkstra_states) && isassigned(g.dijkstra_states, 1)
4545
add_dijkstra_states!(osg)
4646
else
4747
osg.dijkstra_states = Vector{Vector{U}}(undef, length(osg.nodes))

test/subgraph.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ graphs = [
1313
@test sg.ways == g.ways
1414
@test sg.restrictions == g.restrictions
1515
@test sg.weight_type == g.weight_type
16-
@test isdefined(sg.dijkstra_states, 1) == isdefined(g.dijkstra_states, 1)
17-
if isdefined(g.dijkstra_states, 1)
16+
@test isassigned(sg.dijkstra_states, 1) == isassigned(g.dijkstra_states, 1)
17+
if isassigned(g.dijkstra_states, 1)
1818
@test sg.dijkstra_states == g.dijkstra_states
1919
end
2020
@test isdefined(sg.kdtree, 1) == isdefined(g.kdtree, 1)

0 commit comments

Comments
 (0)