@@ -96,14 +96,14 @@ const issue639report = []
9696 @test isequal (exs[2 ], Revise. RelocatableExpr (:(g (x) = sin (x))))
9797 @test ! isequal (exs[1 ], Revise. RelocatableExpr (:(g (x) = sin (x))))
9898 @test string (rex) == """
99- quote
100- f(x) = begin
101- x ^ 2
102- end
103- g(x) = begin
104- sin(x)
105- end
106- end"""
99+ quote
100+ f(x) = begin
101+ x ^ 2
102+ end
103+ g(x) = begin
104+ sin(x)
105+ end
106+ end"""
107107 end
108108
109109 do_test (" Equality and hashing" ) && @testset " Equality and hashing" begin
@@ -118,14 +118,14 @@ end"""
118118 do_test (" Parse errors" ) && @testset " Parse errors" begin
119119 md = Revise. ModuleExprsSigs (Main)
120120 @test_throws LoadError Revise. parse_source! (md, """
121- begin # this block should parse correctly, cf. issue #109
121+ begin # this block should parse correctly, cf. issue #109
122122
123- end
124- f(x) = 1
125- g(x) = 2
126- h{x) = 3 # error
127- k(x) = 4
128- """ , " test" , Main)
123+ end
124+ f(x) = 1
125+ g(x) = 2
126+ h{x) = 3 # error
127+ k(x) = 4
128+ """ , " test" , Main)
129129
130130 # Issue #448
131131 testdir = newtestdir ()
@@ -312,6 +312,10 @@ k(x) = 4
312312 @test length (Revise. actions (rlogger)) == 6 # by default LineOffset is skipped
313313 @test length (Revise. actions (rlogger; line= true )) == 9
314314 @test_broken length (Revise. diffs (rlogger)) == 2
315+ io = PipeBuffer ()
316+ foreach (rec -> show (io, rec), rlogger. logs)
317+ foreach (rec -> show (io, rec; verbose= false ), rlogger. logs)
318+ @test count (" Revise.LogRecord" , read (io, String)) > 8
315319 empty! (rlogger. logs)
316320
317321 # Backtraces. Note this doesn't test the line-number correction
@@ -362,6 +366,11 @@ k(x) = 4
362366 rex3 = Revise. RelocatableExpr (:(x = $ sym3))
363367 @test isequal (rex1, rex3)
364368 @test hash (rex1) == hash (rex3)
369+
370+ # coverage
371+ rex = convert (Revise. RelocatableExpr, :(a = 1 ))
372+ @test Revise. striplines! (rex) isa Revise. RelocatableExpr
373+ @test copy (rex) != = rex
365374 end
366375
367376 do_test (" Display" ) && @testset " Display" begin
@@ -902,7 +911,7 @@ k(x) = 4
902911 """ )
903912 sleep (mtimedelay)
904913 write (joinpath (dn, " file.jl" ), " struct Ord2 end" )
905- @info " The following error messge is expected for this broken test"
914+ @info " The following error message is expected for this broken test"
906915 yry ()
907916 @test_broken Order2. f (Order2. Ord2 ()) == 1
908917 # Resolve it with retry
@@ -3574,6 +3583,20 @@ do_test("includet with mod arg (issue #689)") && @testset "includet with mod arg
35743583 @test Driver. Codes. Common. foo == 2
35753584end
35763585
3586+ do_test (" misc - coverage" ) && @testset " misc - coverage" begin
3587+ @test Revise. ReviseEvalException (" undef" , UndefVarError (:foo )). loc isa String
3588+ @test ! Revise. throwto_repl (UndefVarError (:foo ))
3589+
3590+ @test endswith (Revise. fallback_juliadir (), " julia" )
3591+
3592+ @test isnothing (Revise. revise (REPL. REPLBackend ()))
3593+ end
3594+
3595+ do_test (" deprecated" ) && @testset " deprecated" begin
3596+ @test_logs (:warn , r" `steal_repl_backend` has been removed.*" ) Revise. async_steal_repl_backend ()
3597+ @test_logs (:warn , r" `steal_repl_backend` has been removed.*" ) Revise. wait_steal_repl_backend ()
3598+ end
3599+
35773600println (" beginning cleanup" )
35783601GC. gc (); GC. gc ()
35793602
@@ -3605,7 +3628,6 @@ GC.gc(); GC.gc(); GC.gc() # work-around for https://github.com/JuliaLang/julia
36053628
36063629# see #532 Fix InitError opening none existent Project.toml
36073630function load_in_empty_project_test ()
3608-
36093631 # This will try to load Revise in a julia seccion
36103632 # with an empty enviroment (missing Project.toml)
36113633
@@ -3614,20 +3636,20 @@ function load_in_empty_project_test()
36143636 @assert isfile (revise_proj)
36153637
36163638 src = """
3617- import Pkg
3618- Pkg.activate("fake_env")
3619- @assert !isfile(Base.active_project())
3639+ import Pkg
3640+ Pkg.activate("fake_env")
3641+ @assert !isfile(Base.active_project())
36203642
3621- # force to load the package env Revise version
3622- empty!(LOAD_PATH)
3623- push!(LOAD_PATH, "$revise_proj ")
3643+ # force to load the package env Revise version
3644+ empty!(LOAD_PATH)
3645+ push!(LOAD_PATH, "$revise_proj ")
36243646
3625- @info "A warning about no Manifest.toml file found is expected"
3626- try; using Revise
3627- catch err
3628- # just fail for this error (see #532)
3629- err isa InitError && rethrow(err)
3630- end
3647+ @info "A warning about no Manifest.toml file found is expected"
3648+ try; using Revise
3649+ catch err
3650+ # just fail for this error (see #532)
3651+ err isa InitError && rethrow(err)
3652+ end
36313653 """
36323654 cmd = ` $julia --project=@. -E $src `
36333655
@@ -3636,6 +3658,7 @@ function load_in_empty_project_test()
36363658 true
36373659 end
36383660end
3661+
36393662do_test (" Import in empty enviroment (issue #532)" ) && @testset " Import in empty enviroment (issue #532)" begin
36403663 load_in_empty_project_test ();
36413664end
0 commit comments