Skip to content

Commit b5e3b39

Browse files
committed
add test, bump CSTParser ver requirement
1 parent cf0c9dd commit b5e3b39

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1515

1616
[compat]
1717
julia = "1"
18-
CSTParser = "3"
18+
CSTParser = "3.1"
1919
SymbolServer = "5.1.1"
2020

2121
[targets]

test/runtests.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,3 +1476,17 @@ end
14761476
""")
14771477
@test !StaticLint.haserror(cst.args[2])
14781478
end
1479+
1480+
@testset "reparse" begin
1481+
cst = parse_and_pass("""
1482+
x = 1
1483+
function f(arg)
1484+
x
1485+
end
1486+
""")
1487+
@test StaticLint.hasref(cst.args[2].args[2].args[1])
1488+
StaticLint.clear_meta(cst[2])
1489+
@test !StaticLint.hasref(cst.args[2].args[2].args[1])
1490+
StaticLint.semantic_pass(server.files[""], CSTParser.EXPR[cst[2]])
1491+
@test StaticLint.hasref(cst.args[2].args[2].args[1])
1492+
end

0 commit comments

Comments
 (0)