From e4747be5b796f1fcc1b7e1868fd59715472a7cd7 Mon Sep 17 00:00:00 2001 From: Garrison Jensen Date: Mon, 29 Apr 2024 10:44:38 -0700 Subject: [PATCH] Add spec tests to * to check for *0 --- spec/sorted_array_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/sorted_array_spec.rb b/spec/sorted_array_spec.rb index 3a24d80..0505f8a 100644 --- a/spec/sorted_array_spec.rb +++ b/spec/sorted_array_spec.rb @@ -39,6 +39,12 @@ array *= 2 expect(array.to_a).to eq(((1..1000).to_a * 2).sort) end + + it "should multiply the array by 0" do + array = SortedContainers::SortedArray.new([1, 2, 3, 4, 5]) + array *= 0 + expect(array.to_a).to eq([]) + end end describe "+" do