diff --git a/src/WeakRefStrings.jl b/src/WeakRefStrings.jl index 2168cbc..32e80e9 100644 --- a/src/WeakRefStrings.jl +++ b/src/WeakRefStrings.jl @@ -408,7 +408,7 @@ function Base.push!(arr::StringVector, val::Missing) push!(arr.lengths, 0) end -function Base.deleteat!(arr::StringVector, idx::Integer) +function Base.deleteat!(arr::StringVector, idx) deleteat!(arr.lengths, idx) deleteat!(arr.offsets, idx) arr diff --git a/test/runtests.jl b/test/runtests.jl index 273a147..3720d45 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -194,4 +194,16 @@ end sv = StringVector{EscapedString{UInt8('"')}}(["Text\"\"inner quote\"\"Parse", "JuliaDB"]) @test sv[1] == "Text\"inner quote\"Parse" end + + @testset "deleteat!" begin + sv1 = StringVector{WeakRefString{UInt8}}(["foo", "bar"]) + @test deleteat!(copy(sv1), 1) == ["bar"] + @test deleteat!(copy(sv1), [1,2]) == [] + @test deleteat!(copy(sv1), 1:2) == [] + + sv2 = StringVector{String}(["baz", "qux"]) + @test deleteat!(copy(sv2), 1) == ["qux"] + @test deleteat!(copy(sv2), [1,2]) == [] + @test deleteat!(copy(sv2), 1:2) == [] + end end