Commit 31a7b40d
31a7b40d083cMerged
Yukihiro "Matz" Matsumoto <[email protected]> · 7 months ago · 1 file · +1 added
Description
test: Symbol Phase 2 Step 4d - case/when with symbols
case/when with sp_sym values was already correct (int equality compare via the non-string path in compile_when_conds). Lock the behavior in with test/bm_sym_case.rb.
71/71 tests pass.
Co-Authored-By: Claude Opus 4.6 (1M context) [email protected]
Details
- Commit
- 31a7b40d083c
- Parent
- eab3eae9c7a1
test/bm_sym_case.rbaddedView file
1+
# Symbol in case/when2+
def classify(sym)3+
case sym4+
when :red then "warm"5+
when :orange then "warm"6+
when :blue then "cool"7+
when :green then "cool"8+
else "unknown"9+
end10+
end11+
12+
puts classify(:red) # warm13+
puts classify(:orange) # warm14+
puts classify(:blue) # cool15+
puts classify(:purple) # unknown