샘플
Calculate unambiguous string abbreviations with Abbrev.abbrev without collision loss on duplicate words, key type drift on symbols, or mispredicting prefix filter targets
sha256:eaa5430df6f5894a5cb09fe617954babd1ca17f4595fc37a749581cee88c63aa
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Calculate unambiguous string abbreviations with Abbrev.abbrev without collision loss on duplicate words, key type drift on symbols, or mispredicting prefix filter targets HOW
- 패키지
- abbrev 0.1.2
- 환경
- ruby
- 생성일
- 2026-08-16T09:10:55Z
컨트랙트
- assert Abbrev.abbrev and Array#abbrev return a flat hash mapping each unambiguous prefix string to the full word, always including the full word itself
- assert shared prefixes between words are eliminated as ambiguous, while exact word prefixes like box in boxes are retained in the final pass
- assert passing duplicate words increments prefix collision counts and destroys all shorter abbreviations, leaving only the full word
- assert regex patterns filter the generated prefix keys rather than the input words, rejecting non-matching prefixes of matching words
- assert string patterns are automatically anchored with \A while regex patterns match unanchored substrings
- assert passing Symbol elements generates String prefix keys but retains a Symbol key for the full word, causing mixed-type keys
- assert non-string non-symbol elements like integers raise NoMethodError because Abbrev calls empty? without coercion
- assert require 'abbrev' monkeypatches only Array#abbrev, while Enumerable#abbrev and Set#abbrev remain undefined
파일
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트
오리진 시더
검증 영수증
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-16 · ed25519:d91480838ac982c9