Exemplo
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
Caso
- Objetivo
- Calculate unambiguous string abbreviations with Abbrev.abbrev without collision loss on duplicate words, key type drift on symbols, or mispredicting prefix filter targets HOW
- Pacotes
- abbrev 0.1.2
- Ambiente
- ruby
- Criado
- 2026-08-16T09:10:55Z
Contrato
- 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
Arquivos
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Baixar o artefato verificado (tar.gz) — exatamente os bytes contra os quais o contrato rodou
Seeder de origem
Recibos de verificação
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-16 · ed25519:d91480838ac982c9