Skip to content

Commit e826472

Browse files
committed
Test the test_utils from runtests.jl
1 parent 70ed1cb commit e826472

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

test/runtests.jl

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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")
1230
end
1331

14-
include("test_utils.jl")
1532
include("parse_stream.jl")
1633
include("parser.jl")
1734
include("diagnostics.jl")

test/test_utils.jl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -389,17 +389,3 @@ function parse_sexpr(code)
389389
end
390390

391391

392-
@testset "Test tools" begin
393-
@test exprs_roughly_equal(Expr(:global, :x, :y),
394-
Expr(:global, Expr(:tuple, :x, :y)))
395-
@test exprs_roughly_equal(Expr(:local, :x, :y),
396-
Expr(:local, Expr(:tuple, :x, :y)))
397-
@test exprs_roughly_equal(1.5,
398-
Expr(:call, :*, 1.5, :f))
399-
@test exprs_roughly_equal(1.5,
400-
Expr(:call, :*, 1.5, :f0))
401-
@test exprs_roughly_equal(Expr(:do, Expr(:macrocall, Symbol("@f"), LineNumberNode(1), Expr(:kw, :a, 1)),
402-
Expr(:->, Expr(:tuple), Expr(:block, LineNumberNode(1)))),
403-
Expr(:do, Expr(:macrocall, Symbol("@f"), LineNumberNode(1), Expr(:(=), :a, 1)),
404-
Expr(:->, Expr(:tuple), Expr(:block, LineNumberNode(1)))))
405-
end

0 commit comments

Comments
 (0)