def test_merge_with_0_not_merged(self):
     with self.assertRaisesRegex(AssertionError,
                                 ".*The value 0 is not supported.*"):
         merge_dims([2, 3], int64_array([3, 0, 5, 7]))
 def test_reduce_with_minus_one(self):
     self.assertListEqual(
         list(merge_dims([1, 2], int64_array([3, -1, 5, 7]))), [3, -1, 7])
 def test_merge_all_dims(self):
     self.assertListEqual(
         list(merge_dims([0, 1, 2, 3], int64_array([3, 2, 5, 7]))), [210])
 def test_merge_last_dim(self):
     self.assertListEqual(
         list(merge_dims([2, 3], int64_array([3, 2, 5, 7]))), [3, 2, 35])
 def test_merge_first_dim(self):
     self.assertListEqual(
         list(merge_dims([0, 1], int64_array([3, 2, 5, 7]))), [6, 5, 7])
 def test_merge_middle_dims(self):
     self.assertListEqual(
         list(merge_dims([1, 2], int64_array([3, 2, 5, 7]))), [3, 10, 7])