Skip to content

Commit

Permalink
Add spec for Array#- with different generic type arguments (#12049)
Browse files Browse the repository at this point in the history
Co-authored-by: Sijawusz Pur Rahnama <sija@sija.pl>
  • Loading branch information
straight-shoota and Sija authored May 13, 2022
1 parent 96160a5 commit d00a3b3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/std/array_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ describe "Array" do
it "does with even larger arrays" do
((1..64).to_a - (1..32).to_a).should eq((33..64).to_a)
end

context "with different types" do
it "small array" do
([1, 2, 3, 'c'] - [2, nil]).should eq [1, 3, 'c']
end

it "big array" do
(((1..64).to_a + ['c']) - ((2..63).to_a + [nil])).should eq [1, 64, 'c']
end
end
end

it "does *" do
Expand Down

0 comments on commit d00a3b3

Please sign in to comment.