Skip to content

follow up to: "relax some doctests to better match non-requirement of ordering of Dict and Set" #58053

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions base/abstractdict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ But `keys(a)`, `values(a)` and `pairs(a)` all iterate `a`
and return the elements in the same order.
# Examples
```jldoctest
```jldoctest; filter = r"^\\s+'\\S'.*\$"m
julia> D = Dict('a'=>2, 'b'=>3)
Dict{Char, Int64} with 2 entries:
'a' => 2
Expand All @@ -118,7 +118,7 @@ But `keys(a)`, `values(a)` and `pairs(a)` all iterate `a`
and return the elements in the same order.
# Examples
```jldoctest
```jldoctest; filter = r"^\\s+\\S+(\\s+=>\\s+\\d)?\$"m
julia> D = Dict('a'=>2, 'b'=>3)
Dict{Char, Int64} with 2 entries:
'a' => 2
Expand Down Expand Up @@ -332,7 +332,7 @@ value for that key will be the value it has in the last collection listed.
See also [`mergewith`](@ref) for custom handling of values with the same key.
# Examples
```jldoctest
```jldoctest; filter = r"^\\s+\\S+\\s+=>\\s+\\S+\$"m
julia> a = Dict("foo" => 0.0, "bar" => 42.0)
Dict{String, Float64} with 2 entries:
"bar" => 42.0
Expand Down Expand Up @@ -377,7 +377,7 @@ Method `merge(combine::Union{Function,Type}, args...)` as an alias of
`mergewith` requires Julia 1.5 or later.
# Examples
```jldoctest
```jldoctest; filter = r"^\\s+\\S+\\s+=>\\s+\\S+\$"m
julia> a = Dict("foo" => 0.0, "bar" => 42.0)
Dict{String, Float64} with 2 entries:
"bar" => 42.0
Expand Down
4 changes: 2 additions & 2 deletions base/dict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ end
Determine whether a collection has a mapping for a given `key`.
# Examples
```jldoctest
```jldoctest; filter = r"^\\s+\\S+\\s+=>\\s+\\d\$"m
julia> D = Dict('a'=>2, 'b'=>3)
Dict{Char, Int64} with 2 entries:
'a' => 2
Expand All @@ -554,7 +554,7 @@ in(key, v::KeySet{<:Any, <:Dict}) = (ht_keyindex(v.dict, key) >= 0)
Return the key matching argument `key` if one exists in `collection`, otherwise return `default`.
# Examples
```jldoctest
```jldoctest; filter = r"^\\s+\\S+\\s+=>\\s+\\d\$"m
julia> D = Dict('a'=>2, 'b'=>3)
Dict{Char, Int64} with 2 entries:
'a' => 2
Expand Down
2 changes: 1 addition & 1 deletion base/set.jl
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ If `count` is specified, then replace at most `count` occurrences in total.
See also [`replace`](@ref replace(A, old_new::Pair...)).
# Examples
```jldoctest
```jldoctest; filter = r"^\\s+\\d\$"m
julia> replace!([1, 2, 1, 3], 1=>0, 2=>4, count=2)
4-element Vector{Int64}:
0
Expand Down