Skip to content

Commit

Permalink
forward-port #53096 to nightly, fix the intermittent REPL test failure (
Browse files Browse the repository at this point in the history
#53097)

While the original issue #52739 has been observed only in v1.10, the
necessity to enhance the robustness of the corresponding test code is
still applicable in the nightly. See #53096 for the details.
  • Loading branch information
aviatesk authored Jan 29, 2024
1 parent 0588cd4 commit 741b5da
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions stdlib/REPL/test/replcompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ let s = "CompletionFoo.?([1,2,3], 2.0)"
c, r, res = test_complete(s)
@test !res
@test length(c) == 1
@test occursin("test(x::AbstractArray{T}, y) where T<:Real", c[1])
@test occursin("test(x::AbstractArray{T}, y) where T<:Real", only(c))
# In particular, this checks that test(args...) is not a valid completion
# since it is strictly less specific than test(x::AbstractArray{T}, y)
end
Expand Down Expand Up @@ -682,15 +682,15 @@ let s = "CompletionFoo.?(false, \"a\", 3, "
c, r, res = test_complete(s)
@test !res
@test length(c) == 2
@test occursin("test(args...)", c[1])
@test occursin("test11(a::Integer, b, c)", c[2])
@test any(s->occursin("test(args...)", s), c)
@test any(s->occursin("test11(a::Integer, b, c)", s), c)
end

let s = "CompletionFoo.?(false, \"a\", 3, "
c, r, res = test_complete_noshift(s)
@test !res
@test length(c) == 1
@test occursin("test11(a::Integer, b, c)", c[1])
@test occursin("test11(a::Integer, b, c)", only(c))
end

let s = "CompletionFoo.?(\"a\", 3, "
Expand All @@ -713,7 +713,7 @@ let s = "CompletionFoo.?()"
c, r, res = test_complete_noshift(s)
@test !res
@test length(c) == 1
@test occursin("test10(s::String...)", c[1])
@test occursin("test10(s::String...)", only(c))
end

#= TODO: restrict the number of completions when a semicolon is present in ".?(" syntax
Expand All @@ -731,7 +731,7 @@ let s = "CompletionFoo.?(3; len2=5, "
c, r, res = test_complete_noshift(s)
@test !res
@test length(c) == 1
@test occursin("kwtest3(a::Integer; namedarg, foobar, slurp...)", c[1])
@test occursin("kwtest3(a::Integer; namedarg, foobar, slurp...)", only(c))
# the other two kwtest3 methods should not appear because of specificity
end
=#
Expand Down

0 comments on commit 741b5da

Please sign in to comment.