mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Add a workaround for https://github.com/crystal-lang/crystal/pull/6032
This commit is contained in:
parent
c2aa526e21
commit
eab5499f8e
5 changed files with 46 additions and 12 deletions
|
@ -137,6 +137,17 @@ module Ameba::Rule
|
|||
subject.catch(s).should be_valid
|
||||
end
|
||||
|
||||
it "doesn't report if arg if referenced in case" do
|
||||
s = Source.new %(
|
||||
def foo(a)
|
||||
case a
|
||||
when /foo/
|
||||
end
|
||||
end
|
||||
)
|
||||
subject.catch(s).should be_valid
|
||||
end
|
||||
|
||||
context "super" do
|
||||
it "reports if variable is not referenced implicitly by super" do
|
||||
s = Source.new %(
|
||||
|
|
|
@ -582,6 +582,18 @@ module Ameba::Rule
|
|||
s.errors.first.location.to_s.should eq ":5:17"
|
||||
s.errors.last.location.to_s.should eq ":7:17"
|
||||
end
|
||||
|
||||
it "doesn't report if assignment is referenced in cond" do
|
||||
s = Source.new %(
|
||||
def method
|
||||
a = 2
|
||||
case a
|
||||
when /foo/
|
||||
end
|
||||
end
|
||||
)
|
||||
subject.catch(s).should be_valid
|
||||
end
|
||||
end
|
||||
|
||||
context "binary operator" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue