We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 96fb8c8 commit 60e2627Copy full SHA for 60e2627
src/xmlutils/findnode.jl
@@ -245,7 +245,7 @@ function parse_textindices(indicesstr::String)
245
indicesExpr.head == :vect || error("give indices as a vetor e.g. [2:3], [2, 3] ,[:]")
246
indices = eval(indicesExpr)
247
# TODO find a better way
248
- if typeof(indices) <: Vector{UnitRange{Int64}}
+ if typeof(indices) <: Vector{<:Union{UnitRange{Int64},Colon}}
249
indices = indices[1]
250
end
251
test/xmlutils.jl
@@ -113,6 +113,17 @@ using AcuteML, Test
113
@test_broken ["txt1-uu", "txt2-uu"] == findcontent(Vector{String}, "[1:2]", n, AbsText)
114
@test_broken ["txt1-uu", "txt2-uu", "txt3-u"] == findcontent(Vector{String}, "[1:2]", n, AbsText)
115
116
+ n = createnode(AbsNormal, "p")
117
+ addnode!(n, "n1", "1", AbsNormal)
118
+ addnode!(n, "n2", "2", AbsNormal)
119
+ addnode!(n, "n3", "3", AbsNormal)
120
+ addnode!(n, "n4", "4", AbsNormal)
121
+ # puts form 1 to end
122
+ addnode!(n, "[:]", ["txt1", "txt2"], AbsText) # Adds text inside n1 and n2
123
+ @test ["txt1", "txt2"] == findcontent(Vector{String}, "[:]", n, AbsText)
124
+ updatecontent!(["txt1-u", "txt2"], "[:]", n, AbsText)
125
+ @test ["txt1-u", "txt2"] == findcontent(Vector{String}, "[:]", n, AbsText)
126
+
127
n = createnode(AbsNormal, "a")
128
addnode!(n, "1", 1, AbsText)
129
@test 1 == findcontent(Int64, "1", n, AbsText)
0 commit comments