Commit e0f7bac7
e0f7bac7c300Merged
Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 12 files · +2 added · ~2 modified · -8 deleted
Description
test: collapse Array set-operator and inject/reduce duplicates
array_amp / array_minus / array_pipe were three near-identical tests covering Array#&, Array#-, Array#|. Each had the same shape: 4 typed-array branches + variable-receiver + chained. Collapse into one array_set_ops.rb. (Element semantics live in the existing array_intersection / array_difference / array_union files; these three files were only the operator-dispatch path.)
int_array_inject and int_array_reduce shared the entire body verbatim except for the method name. Merge into int_array_reduce.rb covering both entry points so a divergence at either surfaces.
Net: 5 .rb files → 2. ~3.6s saved on Windows test step at the ~1.2s/test rate measured under the bundling experiment.
Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]
Details
- Commit
- e0f7bac7c300
- Parent
- b41ab26f6304
test/array_amp.rbdeleted
# Array#& dispatches to the typed-array intersect helpers.# Element semantics are covered in test/array_intersection.rb;# this test only exercises the operator dispatch path.# Each typed-array branch.puts ([1, 2, 3, 4] & [3, 4, 5]).inspectputs (["a", "b", "c"] & ["b", "c"]).inspectputs ([1.0, 2.0, 3.0] & [2.0, 3.0]).inspectputs ([:a, :b, :c] & [:b, :c]).inspect# Variable receiver: literal operands take a different path.a = [1, 2, 3, 4]puts (a & [3, 4, 5]).inspect# Chained: the left `&` must be inferred as int_array.puts ([1, 2, 3, 4] & [2, 3, 4] & [3, 4]).inspecttest/array_amp.rb.expecteddeleted
Loading diff…
test/array_minus.rbdeleted
Loading diff…
test/array_minus.rb.expecteddeleted
Loading diff…
test/array_pipe.rbdeleted
Loading diff…
test/array_pipe.rb.expecteddeleted
Loading diff…
test/array_set_ops.rbaddedView file
Loading diff…
test/array_set_ops.rb.expectedaddedView file
Loading diff…
test/int_array_inject.rbdeleted
Loading diff…
test/int_array_inject.rb.expecteddeleted
Loading diff…
test/int_array_reduce.rbmodifiedView file
Loading diff…
test/int_array_reduce.rb.expectedmodifiedView file
Loading diff…