mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
parent
d843afd962
commit
429f76f8b6
3 changed files with 21 additions and 11 deletions
|
@ -39,6 +39,22 @@ module Ameba::AST
|
|||
flow_expression.unreachable_nodes.should eq nodes.assign_nodes
|
||||
end
|
||||
|
||||
it "returns nil if there is no unreachable node after loop" do
|
||||
nodes = as_nodes %(
|
||||
def run
|
||||
idx = items.size - 1
|
||||
while 0 <= idx
|
||||
return
|
||||
end
|
||||
|
||||
puts "foo"
|
||||
end
|
||||
)
|
||||
node = nodes.expressions_nodes.first
|
||||
flow_expression = FlowExpression.new node, false
|
||||
flow_expression.unreachable_nodes.empty?.should eq true
|
||||
end
|
||||
|
||||
it "returns nil if there is no unreachable node" do
|
||||
nodes = as_nodes %(
|
||||
def foobar
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue