Skip to content

Commit d6ec22d

Browse files
committed
Fix doctests & testsuite
1 parent 46290f3 commit d6ec22d

File tree

11 files changed

+29
-29
lines changed

11 files changed

+29
-29
lines changed

base/atomics.jl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Atomic objects can be accessed using the `[]` notation:
6060
# Examples
6161
```jldoctest
6262
julia> x = Threads.Atomic{Int}(3)
63-
Base.Threads.Atomic{Int64}(3)
63+
Threads.Atomic{Int64}(3)
6464
6565
julia> x[] = 1
6666
1
@@ -107,17 +107,17 @@ time.
107107
# Examples
108108
```jldoctest
109109
julia> x = Threads.Atomic{Int}(3)
110-
Base.Threads.Atomic{Int64}(3)
110+
Threads.Atomic{Int64}(3)
111111
112112
julia> Threads.atomic_cas!(x, 4, 2);
113113
114114
julia> x
115-
Base.Threads.Atomic{Int64}(3)
115+
Threads.Atomic{Int64}(3)
116116
117117
julia> Threads.atomic_cas!(x, 3, 2);
118118
119119
julia> x
120-
Base.Threads.Atomic{Int64}(2)
120+
Threads.Atomic{Int64}(2)
121121
```
122122
"""
123123
function atomic_cas! end
@@ -135,7 +135,7 @@ For further details, see LLVM's `atomicrmw xchg` instruction.
135135
# Examples
136136
```jldoctest
137137
julia> x = Threads.Atomic{Int}(3)
138-
Base.Threads.Atomic{Int64}(3)
138+
Threads.Atomic{Int64}(3)
139139
140140
julia> Threads.atomic_xchg!(x, 2)
141141
3
@@ -159,7 +159,7 @@ For further details, see LLVM's `atomicrmw add` instruction.
159159
# Examples
160160
```jldoctest
161161
julia> x = Threads.Atomic{Int}(3)
162-
Base.Threads.Atomic{Int64}(3)
162+
Threads.Atomic{Int64}(3)
163163
164164
julia> Threads.atomic_add!(x, 2)
165165
3
@@ -183,7 +183,7 @@ For further details, see LLVM's `atomicrmw sub` instruction.
183183
# Examples
184184
```jldoctest
185185
julia> x = Threads.Atomic{Int}(3)
186-
Base.Threads.Atomic{Int64}(3)
186+
Threads.Atomic{Int64}(3)
187187
188188
julia> Threads.atomic_sub!(x, 2)
189189
3
@@ -206,7 +206,7 @@ For further details, see LLVM's `atomicrmw and` instruction.
206206
# Examples
207207
```jldoctest
208208
julia> x = Threads.Atomic{Int}(3)
209-
Base.Threads.Atomic{Int64}(3)
209+
Threads.Atomic{Int64}(3)
210210
211211
julia> Threads.atomic_and!(x, 2)
212212
3
@@ -229,7 +229,7 @@ For further details, see LLVM's `atomicrmw nand` instruction.
229229
# Examples
230230
```jldoctest
231231
julia> x = Threads.Atomic{Int}(3)
232-
Base.Threads.Atomic{Int64}(3)
232+
Threads.Atomic{Int64}(3)
233233
234234
julia> Threads.atomic_nand!(x, 2)
235235
3
@@ -252,7 +252,7 @@ For further details, see LLVM's `atomicrmw or` instruction.
252252
# Examples
253253
```jldoctest
254254
julia> x = Threads.Atomic{Int}(5)
255-
Base.Threads.Atomic{Int64}(5)
255+
Threads.Atomic{Int64}(5)
256256
257257
julia> Threads.atomic_or!(x, 7)
258258
5
@@ -275,7 +275,7 @@ For further details, see LLVM's `atomicrmw xor` instruction.
275275
# Examples
276276
```jldoctest
277277
julia> x = Threads.Atomic{Int}(5)
278-
Base.Threads.Atomic{Int64}(5)
278+
Threads.Atomic{Int64}(5)
279279
280280
julia> Threads.atomic_xor!(x, 7)
281281
5
@@ -298,7 +298,7 @@ For further details, see LLVM's `atomicrmw max` instruction.
298298
# Examples
299299
```jldoctest
300300
julia> x = Threads.Atomic{Int}(5)
301-
Base.Threads.Atomic{Int64}(5)
301+
Threads.Atomic{Int64}(5)
302302
303303
julia> Threads.atomic_max!(x, 7)
304304
5
@@ -321,7 +321,7 @@ For further details, see LLVM's `atomicrmw min` instruction.
321321
# Examples
322322
```jldoctest
323323
julia> x = Threads.Atomic{Int}(7)
324-
Base.Threads.Atomic{Int64}(7)
324+
Threads.Atomic{Int64}(7)
325325
326326
julia> Threads.atomic_min!(x, 5)
327327
7

base/broadcast.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ Uses [`BroadcastStyle`](@ref) to get the style for each argument, and uses
417417
418418
```jldoctest
419419
julia> Broadcast.combine_styles([1], [1 2; 3 4])
420-
Base.Broadcast.DefaultArrayStyle{2}()
420+
Broadcast.DefaultArrayStyle{2}()
421421
```
422422
"""
423423
function combine_styles end
@@ -441,10 +441,10 @@ determine a common `BroadcastStyle`.
441441
442442
```jldoctest
443443
julia> Broadcast.result_style(Broadcast.DefaultArrayStyle{0}(), Broadcast.DefaultArrayStyle{3}())
444-
Base.Broadcast.DefaultArrayStyle{3}()
444+
Broadcast.DefaultArrayStyle{3}()
445445
446446
julia> Broadcast.result_style(Broadcast.Unknown(), Broadcast.DefaultArrayStyle{1}())
447-
Base.Broadcast.DefaultArrayStyle{1}()
447+
Broadcast.DefaultArrayStyle{1}()
448448
```
449449
"""
450450
function result_style end

base/iterators.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ See [`Base.filter`](@ref) for an eager implementation of filtering for arrays.
526526
# Examples
527527
```jldoctest
528528
julia> f = Iterators.filter(isodd, [1, 2, 3, 4, 5])
529-
Base.Iterators.Filter{typeof(isodd), Vector{Int64}}(isodd, [1, 2, 3, 4, 5])
529+
Iterators.Filter{typeof(isodd), Vector{Int64}}(isodd, [1, 2, 3, 4, 5])
530530
531531
julia> foreach(println, f)
532532
1

doc/src/manual/functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ julia> a
505505
1
506506
507507
julia> b
508-
Base.Iterators.Rest{Base.Generator{UnitRange{Int64}, typeof(abs2)}, Int64}(Base.Generator{UnitRange{Int64}, typeof(abs2)}(abs2, 1:4), 1)
508+
Iterators.Rest{Base.Generator{UnitRange{Int64}, typeof(abs2)}, Int64}(Base.Generator{UnitRange{Int64}, typeof(abs2)}(abs2, 1:4), 1)
509509
```
510510

511511
See [`Base.rest`](@ref) for details on the precise handling and customization for specific iterators.

stdlib/InteractiveUtils/test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ end
258258

259259
const curmod = @__MODULE__
260260
const curmod_name = fullname(curmod)
261-
const curmod_str = curmod === Main ? "Main" : join(curmod_name, ".")
261+
const curmod_str = curmod === Main ? "Main" : join(curmod_name[2:end], ".")
262262

263263
@test_throws ErrorException("\"this_is_not_defined\" is not defined in module $curmod_str") @which this_is_not_defined
264264
# issue #13264

stdlib/REPL/test/repl.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ fake_repl() do stdin_write, stdout_read, repl
11251125
t = @async write(stdin_write, "TestShowTypeREPL.TypeA\n")
11261126
s = readuntil(stdout_read, "\n\n")
11271127
s2 = rsplit(s, "\n", limit=2)[end]
1128-
@test s2 == "\e[0mMain.TestShowTypeREPL.TypeA"
1128+
@test s2 == "\e[0mTestShowTypeREPL.TypeA"
11291129
wait(t)
11301130
@eval Main using .TestShowTypeREPL
11311131
readuntil(stdout_read, "julia> ", keep=true)
@@ -1277,16 +1277,16 @@ f_html() = nothing
12771277
end # module BriefExtended
12781278

12791279
buf = IOBuffer()
1280-
md = Base.eval(REPL._helpmode(buf, "$(@__MODULE__).BriefExtended.f"))
1280+
md = (@__MODULE__).eval(REPL._helpmode(buf, "$curmod_str.BriefExtended.f"))
12811281
@test length(md.content) == 2 && isa(md.content[2], REPL.Message)
12821282
buf = IOBuffer()
1283-
md = Base.eval(REPL._helpmode(buf, "?$(@__MODULE__).BriefExtended.f"))
1283+
md = (@__MODULE__).eval(REPL._helpmode(buf, "?$curmod_str.BriefExtended.f"))
12841284
@test length(md.content) == 1 && length(md.content[1].content[1].content) == 4
12851285
buf = IOBuffer()
1286-
txt = Base.eval(REPL._helpmode(buf, "$(@__MODULE__).BriefExtended.f_plain"))
1286+
txt = (@__MODULE__).eval(REPL._helpmode(buf, "$curmod_str.BriefExtended.f_plain"))
12871287
@test !isempty(sprint(show, txt))
12881288
buf = IOBuffer()
1289-
html = Base.eval(REPL._helpmode(buf, "$(@__MODULE__).BriefExtended.f_html"))
1289+
html = (@__MODULE__).eval(REPL._helpmode(buf, "$curmod_str.BriefExtended.f_html"))
12901290
@test !isempty(sprint(show, html))
12911291

12921292
# PR #27562

test/backtrace.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ let code = """
288288

289289
bt_str = read(`$(Base.julia_cmd()) --startup-file=no --compile=min -e $code`, String)
290290
@test occursin(r"InterpreterIP in MethodInstance for .*A\.foo", bt_str)
291-
@test occursin("InterpreterIP in top-level CodeInfo for Main.A", bt_str)
291+
@test occursin("InterpreterIP in top-level CodeInfo for A", bt_str)
292292
end
293293

294294
"""

test/broadcast.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ p0 = copy(p)
10131013
@test identity(.+) == Broadcast.BroadcastFunction(+)
10141014
@test identity.(.*) == Broadcast.BroadcastFunction(*)
10151015
@test map(.+, [[1,2], [3,4]], [5, 6]) == [[6,7], [9,10]]
1016-
@test repr(.!) == "Base.Broadcast.BroadcastFunction(!)"
1016+
@test repr(.!) == "Broadcast.BroadcastFunction(!)"
10171017
@test eval(:(.+)) == Base.BroadcastFunction(+)
10181018

10191019
@testset "Issue #5187: Broadcasting of short-circuiting ops" begin

test/docs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ let x = Binding(Main, :+)
12851285
end
12861286

12871287
let x = Binding(Meta, :parse)
1288-
@test Meta.parse(string(x)) == :(Base.Meta.parse)
1288+
@test Meta.parse(string(x)) == :(Meta.parse)
12891289
end
12901290

12911291
let x = Binding(Main, :)

test/show.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1823,7 +1823,7 @@ end
18231823

18241824
b = IOBuffer()
18251825
show(IOContext(b, :module => @__MODULE__), TestShowType.TypeA)
1826-
@test String(take!(b)) == "$(@__MODULE__).TestShowType.TypeA"
1826+
@test String(take!(b)) == "TestShowType.TypeA"
18271827

18281828
b = IOBuffer()
18291829
show(IOContext(b, :module => TestShowType), TestShowType.TypeA)

test/sysinfo.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ end
6666
Base.Sys.CPUinfo("Apple M1 Pro", 2400, 0x00000000017726c0, 0x0000000000000000, 0x00000000009491de, 0x0000000048134f1e, 0x0000000000000000)]
6767

6868
Sys.SC_CLK_TCK, save_SC_CLK_TCK = 100, Sys.SC_CLK_TCK # use platform-independent tick units
69-
@test repr(example_cpus[1]) == "Base.Sys.CPUinfo(\"Apple M1 Pro\", 2400, 0x000000000d913b08, 0x0000000000000000, 0x0000000005f4243c, 0x00000000352a550a, 0x0000000000000000)"
69+
@test repr(example_cpus[1]) == "Sys.CPUinfo(\"Apple M1 Pro\", 2400, 0x000000000d913b08, 0x0000000000000000, 0x0000000005f4243c, 0x00000000352a550a, 0x0000000000000000)"
7070
@test repr("text/plain", example_cpus[1]) == "Apple M1 Pro: \n speed user nice sys idle irq\n 2400 MHz 2276216 s 0 s 998861 s 8919667 s 0 s"
7171
@test sprint(Sys.cpu_summary, example_cpus) == "Apple M1 Pro: \n speed user nice sys idle irq\n#1 2400 MHz 2276216 s 0 s 998861 s 8919667 s 0 s\n#2 2400 MHz 2275576 s 0 s 978101 s 8962204 s 0 s\n#3 2400 MHz 403386 s 0 s 166224 s 11853624 s 0 s\n#4 2400 MHz 245859 s 0 s 97367 s 12092250 s 0 s\n"
7272
Sys.SC_CLK_TCK = save_SC_CLK_TCK

0 commit comments

Comments
 (0)