Skip to content

Commit e998593

Browse files
authored
fully normalize x == ::Symbol to x === ::Symbol (JuliaLang/julia#45944)
It would be better to use a consistent style in our code base. The changes are big, but all merely cosmetic changes made half-automatically with a find-and-replace.
1 parent c5a6820 commit e998593

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

test/distributed_exec.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function testf(id)
126126
@test_throws ErrorException put!(f, :OK) # Cannot put! to a already set future
127127
@test_throws MethodError take!(f) # take! is unsupported on a Future
128128

129-
@test fetch(f) == :OK
129+
@test fetch(f) === :OK
130130
end
131131

132132
testf(id_me)
@@ -218,7 +218,7 @@ isready(f)
218218
@test remotecall_fetch(k->haskey(Distributed.PGRP.refs, k), wid1, fid) == true
219219
put!(f, :OK)
220220
@test remotecall_fetch(k->haskey(Distributed.PGRP.refs, k), wid1, fid) == false
221-
@test fetch(f) == :OK
221+
@test fetch(f) === :OK
222222

223223
# RemoteException should be thrown on a put! when another process has set the value
224224
f = Future(wid1)
@@ -270,7 +270,7 @@ function test_remoteref_dgc(id)
270270

271271
# remote value should be deleted after finalizing the ref
272272
@test remotecall_fetch(k->(yield();haskey(Distributed.PGRP.refs, k)), id, rrid) == true
273-
@test fetch(rr) == :OK
273+
@test fetch(rr) === :OK
274274
@test remotecall_fetch(k->(yield();haskey(Distributed.PGRP.refs, k)), id, rrid) == true
275275
finalize(rr)
276276
yield(); # flush gc msgs
@@ -349,7 +349,7 @@ function test_regular_io_ser(ref::Distributed.AbstractRemoteRef)
349349
v = getfield(ref2, fld)
350350
if isa(v, Number)
351351
@test v === zero(typeof(v))
352-
elseif fld == :lock
352+
elseif fld === :lock
353353
@test v isa ReentrantLock
354354
@test !islocked(v)
355355
elseif v !== nothing
@@ -528,7 +528,7 @@ let ex
528528
bt = ex.captured.processed_bt::Array{Any,1}
529529
@test length(bt) > 1
530530
frame, repeated = bt[1]::Tuple{Base.StackTraces.StackFrame, Int}
531-
@test frame.func == :foo
531+
@test frame.func === :foo
532532
@test frame.linfo === nothing
533533
@test repeated == 1
534534
end
@@ -815,11 +815,11 @@ function f13168(n)
815815
return val
816816
end
817817
let t = schedule(@task f13168(100))
818-
@test t.state == :runnable
818+
@test t.state === :runnable
819819
@test t.queue !== nothing
820820
@test_throws ErrorException schedule(t)
821821
yield()
822-
@test t.state == :done
822+
@test t.state === :done
823823
@test t.queue === nothing
824824
@test_throws ErrorException schedule(t)
825825
@test isa(fetch(t), Float64)
@@ -900,7 +900,7 @@ end
900900
take!(rc)[1] != float(i) && error("Failed")
901901
end
902902
return :OK
903-
end, id_other, rc_unbuffered) == :OK
903+
end, id_other, rc_unbuffered) === :OK
904904

905905
# github issue 33972
906906
rc_unbuffered_other = RemoteChannel(()->Channel{Int}(0), id_other)
@@ -997,7 +997,7 @@ let
997997
@test_throws RemoteException remotecall_fetch(bad_thunk, 2)
998998

999999
# Test that the stream is still usable
1000-
@test remotecall_fetch(()->:test,2) == :test
1000+
@test remotecall_fetch(()->:test,2) === :test
10011001
ref = remotecall(bad_thunk, 2)
10021002
@test_throws RemoteException fetch(ref)
10031003
end
@@ -1175,11 +1175,11 @@ function launch(manager::ErrorSimulator, params::Dict, launched::Array, c::Condi
11751175
dir = params[:dir]
11761176

11771177
cmd = `$(Base.julia_cmd(exename)) --startup-file=no`
1178-
if manager.mode == :timeout
1178+
if manager.mode === :timeout
11791179
cmd = `$cmd -e "sleep(10)"`
1180-
elseif manager.mode == :ntries
1180+
elseif manager.mode === :ntries
11811181
cmd = `$cmd -e "[println(x) for x in 1:1001]"`
1182-
elseif manager.mode == :exit
1182+
elseif manager.mode === :exit
11831183
cmd = `$cmd -e "exit(-1)"`
11841184
else
11851185
error("Unknown mode")

test/topology.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ end
6262

6363
const map_pid_ident=Dict()
6464
function manage(manager::TopoTestManager, id::Integer, config::WorkerConfig, op::Symbol)
65-
if op == :register
65+
if op === :register
6666
map_pid_ident[id] = config.ident
67-
elseif op == :interrupt
67+
elseif op === :interrupt
6868
kill(config.process, 2)
6969
end
7070
end

0 commit comments

Comments
 (0)