@@ -7,11 +7,28 @@ using JuliaSyntax: GreenNode, SyntaxNode,
77 flags, EMPTY_FLAGS, TRIVIA_FLAG, INFIX_FLAG,
88 children, child, setchild!, SyntaxHead
99
10+ include (" test_utils.jl" )
11+ # Tests for the test_utils go here to allow the utils to be included on their
12+ # own without invoking the tests.
13+ @testset " Test tools" begin
14+ @test exprs_roughly_equal (Expr (:global , :x , :y ),
15+ Expr (:global , Expr (:tuple , :x , :y )))
16+ @test exprs_roughly_equal (Expr (:local , :x , :y ),
17+ Expr (:local , Expr (:tuple , :x , :y )))
18+ @test exprs_roughly_equal (1.5 ,
19+ Expr (:call , :* , 1.5 , :f ))
20+ @test exprs_roughly_equal (1.5 ,
21+ Expr (:call , :* , 1.5 , :f0 ))
22+ @test exprs_roughly_equal (Expr (:do , Expr (:macrocall , Symbol (" @f" ), LineNumberNode (1 ), Expr (:kw , :a , 1 )),
23+ Expr (:-> , Expr (:tuple ), Expr (:block , LineNumberNode (1 )))),
24+ Expr (:do , Expr (:macrocall , Symbol (" @f" ), LineNumberNode (1 ), Expr (:(= ), :a , 1 )),
25+ Expr (:-> , Expr (:tuple ), Expr (:block , LineNumberNode (1 )))))
26+ end
27+
1028@testset " Tokenize" begin
1129 include (" tokenize.jl" )
1230end
1331
14- include (" test_utils.jl" )
1532include (" parse_stream.jl" )
1633include (" parser.jl" )
1734include (" diagnostics.jl" )
@@ -20,7 +37,13 @@ include("expr.jl")
2037@testset " Parsing literals from strings" begin
2138 include (" value_parsing.jl" )
2239end
23- include (" hooks.jl" )
24- include (" parse_packages.jl" )
2540include (" source_files.jl" )
2641
42+ if VERSION >= v " 1.6"
43+ # Tests restricted to 1.6+ due to
44+ # * Core._parse hook doesn't exist on v1.5 and lower
45+ # * Reference parser bugs which would need workarounds for package parse comparisons
46+ include (" hooks.jl" )
47+ include (" parse_packages.jl" )
48+ end
49+
0 commit comments