Commit b41ab26f
b41ab26f6304Merged
Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 24 files · +8 added · -16 deleted
Description
test: merge 4 poly/ptr Array operator pairs into single files
Each of array_{concat,each_with_object,flat_map,plus} had a parallel _poly / _ptr variant testing the same operator on different element-type shapes. Merge each pair into one file: 8 .rb files → 4. Per the per-test cc -c cost (~944ms on Windows), this saves ~5s on Windows test step and proportional amounts on the other OS jobs, with no loss of regression coverage.
The merged files use distinct local-variable names across the
poly and ptr sections so spinel's per-method type inference
doesn't unify them to poly across the file (one such collision
showed up while merging flat_map: a shared block-param e widened
to poly across both blocks). One class Bar definition is shared
across the ptr cases per file.
Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]
Details
- Commit
- b41ab26f6304
- Parent
- 5e21d42ac90f
test/array_concat.rbaddedView file
# Array#concat used to silently miss the type-check on both poly_array# and ptr_array — the loop never ran, so the receiver kept its# original length. Both shapes regression-tested here.# poly_array (heterogeneous)a = [1, "x"]a.concat([2, "y"])puts a.length# ptr_array (user objects)class Bar def initialize(x); @x = x; end attr_accessor :xendb = [Bar.new(1)]b.concat([Bar.new(2), Bar.new(3)])puts b.lengthtest/array_concat.rb.expectedaddedView file
Loading diff…
test/array_concat_poly.rbdeleted
Loading diff…
test/array_concat_poly.rb.expecteddeleted
Loading diff…
test/array_concat_ptr.rbdeleted
Loading diff…
test/array_concat_ptr.rb.expecteddeleted
Loading diff…
test/array_each_with_object.rbaddedView file
Loading diff…
test/array_each_with_object.rb.expectedaddedView file
Loading diff…
test/array_each_with_object_poly.rbdeleted
Loading diff…
test/array_each_with_object_poly.rb.expecteddeleted
Loading diff…
test/array_each_with_object_ptr.rbdeleted
Loading diff…
test/array_each_with_object_ptr.rb.expecteddeleted
Loading diff…
test/array_flat_map.rbaddedView file
Loading diff…
test/array_flat_map.rb.expectedaddedView file
Loading diff…
test/array_flat_map_poly.rbdeleted
Loading diff…
test/array_flat_map_poly.rb.expecteddeleted
Loading diff…
test/array_flat_map_ptr.rbdeleted
Loading diff…
test/array_flat_map_ptr.rb.expecteddeleted
Loading diff…
test/array_plus.rbaddedView file
Loading diff…
test/array_plus.rb.expectedaddedView file
Loading diff…
test/array_plus_poly.rbdeleted
Loading diff…
test/array_plus_poly.rb.expecteddeleted
Loading diff…
test/array_plus_ptr.rbdeleted
Loading diff…
test/array_plus_ptr.rb.expecteddeleted
Loading diff…