mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Improve forward compatibility with future crystal version
https://github.com/crystal-ameba/ameba/issues/168#issuecomment-722051876
This commit is contained in:
parent
de3f16a9dc
commit
5b4b1e817d
1 changed files with 7 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
require "../../spec_helper"
|
require "../../spec_helper"
|
||||||
|
require "semantic_version"
|
||||||
|
|
||||||
module Ameba::AST
|
module Ameba::AST
|
||||||
struct Test
|
struct Test
|
||||||
|
@ -76,7 +77,12 @@ module Ameba::AST
|
||||||
)
|
)
|
||||||
node = as_nodes(s).nil_literal_nodes.first
|
node = as_nodes(s).nil_literal_nodes.first
|
||||||
source = subject.node_source node, s.split("\n")
|
source = subject.node_source node, s.split("\n")
|
||||||
source.should be_nil
|
|
||||||
|
if SemanticVersion.parse(Crystal::VERSION) <= SemanticVersion.parse("0.35.1")
|
||||||
|
source.should be_nil
|
||||||
|
else
|
||||||
|
source.should eq %w(nil)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue