mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Incorrectly reporting shadowingOuterLocalVar within macro included
closes #129
This commit is contained in:
parent
43b566a852
commit
aff723b682
5 changed files with 45 additions and 2 deletions
|
@ -84,4 +84,20 @@ module Ameba::AST
|
|||
scope.block?.should be_false
|
||||
end
|
||||
end
|
||||
|
||||
describe "#macro?" do
|
||||
it "returns true if Crystal::Macro" do
|
||||
nodes = as_nodes %(
|
||||
macro included
|
||||
end
|
||||
)
|
||||
scope = Scope.new nodes.macro_nodes.first
|
||||
scope.macro?.should be_true
|
||||
end
|
||||
|
||||
it "returns false otherwise" do
|
||||
scope = Scope.new as_node "a = 1"
|
||||
scope.macro?.should be_false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue