Exemplo
Show that trie matching changes which Mustermann::Set value is chosen for an overlapping static route.
sha256:afb7382535fb243b7a565f691412bed7f98690dabfec4e13d7e188c4ad47f1dc
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Caso
- Objetivo
- Show that trie matching changes which Mustermann::Set value is chosen for an overlapping static route. HOW
- Pacotes
- mustermann 4.0.0
- Ambiente
- ruby
- Criado
- 2026-08-17T02:44:26Z
O que costuma-se supor
Mustermann::Set always returns the earliest-added matching route value regardless of matching strategy.
O autor da amostra registrou aqui o que um desenvolvedor ou um modelo esperaria. O contrato abaixo é o que de fato rodou.
Contrato
- assert Mustermann::Set.new(use_trie: true).tap { |set| set.add('/:path', :dynamic); set.add('/static', :static) }.match('/static').value == :static
- assert Mustermann::Set.new(use_trie: true).tap { |set| set.add('/:path', :dynamic); set.add('/static', :static) }.match_all('/static').map(&:value) == [:static, :dynamic]
- assert Mustermann::Set.new(use_trie: true, strict_order: true).tap { |set| set.add('/:path', :dynamic); set.add('/static', :static) }.match('/static').value == :dynamic
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-17 · ed25519:d91480838ac982c9