|
34 | 34 | end |
35 | 35 |
|
36 | 36 | @testset "parser errors" begin |
37 | | - @test diagnostic("+ #==# (a,b)") == |
| 37 | + @test diagnostic("+ #==# (a,b)") == |
38 | 38 | Diagnostic(2, 7, :error, "whitespace not allowed between prefix function call and argument list") |
39 | 39 | @test diagnostic("1 -+ (a=1, b=2)") == |
40 | 40 | Diagnostic(5, 5, :error, "whitespace not allowed between prefix function call and argument list") |
|
44 | 44 | @test diagnostic("function (\$f) body end") == |
45 | 45 | Diagnostic(10, 13, :error, "Ambiguous signature. Add a trailing comma if this is a 1-argument anonymous function; remove parentheses if this is a macro call acting as function signature.") |
46 | 46 |
|
47 | | - @test diagnostic( "[email protected]", only_first =true) == |
| 47 | + @test diagnostic( "[email protected]", only_first =true) == |
48 | 48 | Diagnostic(3, 4, :error, "`@` must appear on first or last macro name component") |
49 | | - @test diagnostic("@M.(x)") == |
| 49 | + @test diagnostic("@M.(x)") == |
50 | 50 | Diagnostic(1, 3, :error, "dot call syntax not supported for macros") |
51 | 51 |
|
52 | | - @test diagnostic("try x end") == |
| 52 | + @test diagnostic("try x end") == |
53 | 53 | Diagnostic(1, 9, :error, "try without catch or finally") |
54 | 54 | # TODO: better range |
55 | | - @test diagnostic("@A.\$x a") == |
| 55 | + @test diagnostic("@A.\$x a") == |
56 | 56 | Diagnostic(4, 5, :error, "invalid macro name") |
57 | 57 |
|
58 | | - @test diagnostic("a, , b") == |
| 58 | + @test diagnostic("a, , b") == |
59 | 59 | Diagnostic(4, 4, :error, "unexpected `,`") |
60 | 60 | @test diagnostic(")", allow_multiple=true) == [ |
61 | 61 | Diagnostic(1, 1, :error, "unexpected `)`") |
@@ -118,15 +118,15 @@ end |
118 | 118 | end |
119 | 119 |
|
120 | 120 | @testset "parser warnings" begin |
121 | | - @test diagnostic("@(A)", only_first=true) == |
| 121 | + @test diagnostic("@(A)", only_first=true) == |
122 | 122 | Diagnostic(2, 4, :warning, "parenthesizing macro names is unnecessary") |
123 | | - @test diagnostic("try finally catch a ; b end") == |
| 123 | + @test diagnostic("try finally catch a ; b end") == |
124 | 124 | Diagnostic(13, 23, :warning, "`catch` after `finally` will execute out of order") |
125 | | - @test diagnostic("import . .A") == |
| 125 | + @test diagnostic("import . .A") == |
126 | 126 | Diagnostic(9, 10, :warning, "space between dots in import path") |
127 | | - @test diagnostic("import A .==") == |
| 127 | + @test diagnostic("import A .==") == |
128 | 128 | Diagnostic(9, 9, :warning, "space between dots in import path") |
129 | | - @test diagnostic("import A.:+") == |
| 129 | + @test diagnostic("import A.:+") == |
130 | 130 | Diagnostic(10, 10, :warning, "quoting with `:` is not required here") |
131 | 131 | # No warnings for imports of `:` and parenthesized `(..)` |
132 | 132 | @test diagnostic("import A.:, :", allow_multiple=true) == [] |
|
244 | 244 | tempdirname = mktempdir() |
245 | 245 | cd(tempdirname) do |
246 | 246 | rm(tempdirname) |
247 | | - # Test _file_url doesn't fail with nonexistant directories |
248 | | - @test isnothing(JuliaSyntax._file_url(joinpath("__nonexistant__", "test.jl"))) |
| 247 | + # Test _file_url doesn't fail with nonexistent directories |
| 248 | + @test isnothing(JuliaSyntax._file_url(joinpath("__nonexistent__", "test.jl"))) |
249 | 249 | end |
250 | 250 | end |
251 | 251 | end |
0 commit comments