@@ -117,7 +117,8 @@ const issue639report = []
117
117
118
118
do_test (" Parse errors" ) && @testset " Parse errors" begin
119
119
md = Revise. ModuleExprsSigs (Main)
120
- @test_throws LoadError Revise. parse_source! (md, """
120
+ errtype = Base. VERSION < v " 1.10" ? LoadError : Base. Meta. ParseError
121
+ @test_throws errtype Revise. parse_source! (md, """
121
122
begin # this block should parse correctly, cf. issue #109
122
123
123
124
end
@@ -140,9 +141,13 @@ const issue639report = []
140
141
try
141
142
includet (file)
142
143
catch err
143
- @test isa (err, LoadError)
144
- @test err. file == file
145
- @test endswith (errmsg (err. error), Base. VERSION < v " 1.10" ? " requires end" : " Expected `end`" )
144
+ @test isa (err, errtype)
145
+ if Base. VERSION < v " 1.10"
146
+ @test err. file == file
147
+ @test endswith (err. error, " requires end" )
148
+ else
149
+ @test occursin (" Expected `end`" , err. msg)
150
+ end
146
151
end
147
152
end
148
153
@@ -2006,14 +2011,17 @@ const issue639report = []
2006
2011
@test exc. file == fn
2007
2012
@test exc. line == line
2008
2013
@test occursin (msg, errmsg (exc. error))
2014
+ elseif ErrorType === Base. Meta. ParseError
2015
+ @test occursin (msg, exc. msg)
2009
2016
elseif ErrorType === UndefVarError
2010
2017
@test msg == exc. var
2011
2018
end
2012
2019
@test length (st) == 1
2013
2020
end
2014
2021
2015
2022
# test errors are reported the the first time
2016
- check_revision_error (logs[1 ], LoadError, Base. VERSION < v " 1.10" ? " missing comma or }" : " Expected `}`" , 2 + (Base. VERSION >= v " 1.10" ))
2023
+ check_revision_error (logs[1 ], Base. VERSION < v " 1.10" ? LoadError : Base. Meta. ParseError,
2024
+ Base. VERSION < v " 1.10" ? " missing comma or }" : " Expected `}`" , 2 + (Base. VERSION >= v " 1.10" ))
2017
2025
# Check that there's an informative warning
2018
2026
rec = logs[2 ]
2019
2027
@test startswith (rec. message, " The running code does not match" )
@@ -2029,7 +2037,8 @@ const issue639report = []
2029
2037
logs,_ = Test. collect_test_logs () do
2030
2038
Revise. errors ()
2031
2039
end
2032
- check_revision_error (logs[1 ], LoadError, Base. VERSION < v " 1.10" ? " missing comma or }" : " Expected `}`" , 2 + (Base. VERSION >= v " 1.10" ))
2040
+ check_revision_error (logs[1 ], Base. VERSION < v " 1.10" ? LoadError : Base. Meta. ParseError,
2041
+ Base. VERSION < v " 1.10" ? " missing comma or }" : " Expected `}`" , 2 + (Base. VERSION >= v " 1.10" ))
2033
2042
2034
2043
write (joinpath (dn, " RevisionErrors.jl" ), """
2035
2044
module RevisionErrors
@@ -2060,7 +2069,8 @@ const issue639report = []
2060
2069
yry ()
2061
2070
end
2062
2071
delim = Base. VERSION < v " 1.10" ? ' "' : ' `'
2063
- check_revision_error (logs[1 ], LoadError, " unexpected $delim =$delim " , 6 + (Base. VERSION >= v " 1.10" )* 2 )
2072
+ check_revision_error (logs[1 ], Base. VERSION < v " 1.10" ? LoadError : Base. Meta. ParseError,
2073
+ " unexpected $delim =$delim " , 6 + (Base. VERSION >= v " 1.10" )* 2 )
2064
2074
2065
2075
write (joinpath (dn, " RevisionErrors.jl" ), """
2066
2076
module RevisionErrors
@@ -2106,7 +2116,11 @@ const issue639report = []
2106
2116
revise (throw= true )
2107
2117
false
2108
2118
catch err
2109
- isa (err, LoadError) && occursin (Base. VERSION < v " 1.10" ? """ unexpected "}" """ : " Expected `)`" , errmsg (err. error))
2119
+ if Base. VERSION < v " 1.10"
2120
+ isa (err, LoadError) && occursin (""" unexpected "}" """ , errmsg (err. error))
2121
+ else
2122
+ isa (err, Base. Meta. ParseError) && occursin (" Expected `)`" , err. msg)
2123
+ end
2110
2124
end
2111
2125
sleep (mtimedelay)
2112
2126
write (joinpath (dn, " RevisionErrors.jl" ), """
0 commit comments