Commit 5cdf7617

5cdf761735b4Merged

Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 112 files · +8 added · -104 deleted

Description

Fold 52 tiny tests into 4 bundles (string/array/num/misc)

Combine 52 small (<=8-line) standalone tests into four bundled files, each subtest wrapped in def t_<name>; ...; end; t_<name> to isolate locals. This amortizes one cc -c of sp_runtime.h -- the dominant test-step cost -- across many tests instead of paying it per file. No new bundling infrastructure: the bundles are plain test/.rb files following the existing bundle_ convention.

Tests touching process/filesystem state (File/Dir/IO, process_pid, require, at_exit, ...) or defining a top-level class/const/def were left standalone. Each bundle's output was verified to equal the concatenation of the folded tests' .expected files before folding; make test passes them under -Werror with exact comparison.

Co-Authored-By: Claude Opus 4.8 (1M context) [email protected]

Details

Commit
5cdf761735b4
Parent
5097b39b887a

test/array_bsearch.rbdeleted

1-# Array#bsearch (find-minimum mode) on a sorted typed array: returns the
2-# first element for which the block is truthy, or nil when none is.
3-p [1, 3, 5, 7, 9].bsearch { |x| x >= 5 }
4-p [1, 3, 5, 7, 9].bsearch { |x| x >= 100 }
5-p [1, 3, 5, 7, 9].bsearch { |x| x >= 1 }
6-p [2, 4, 6, 8].bsearch { |x| x >= 7 }
7-p ["a", "b", "c", "d"].bsearch { |s| s >= "c" }
8-p ["a", "b", "c", "d"].bsearch { |s| s >= "z" }