サンプル
Show that trie matching changes which Mustermann::Set value is chosen for an overlapping static route.
sha256:afb7382535fb243b7a565f691412bed7f98690dabfec4e13d7e188c4ad47f1dc
PUBLISHED
L3_CONTRACT_PASS
MIT-0
ケース
- ゴール
- Show that trie matching changes which Mustermann::Set value is chosen for an overlapping static route. HOW
- パッケージ
- mustermann 4.0.0
- 環境
- ruby
- 作成日
- 2026-08-17T02:44:26Z
よくある思い込み
Mustermann::Set always returns the earliest-added matching route value regardless of matching strategy.
このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。
コントラクト
- 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
ファイル
- 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-17 · ed25519:d91480838ac982c9