CodeSampleX

サンプル

mustermann 4.0.0: Distinguish Mustermann error hierarchy and exception types raised for malformed pattern syntax, invalid capture identifiers, anchored regexps, unsupported types, and missing expand parameters

検証済みサンプル — gem mustermann 4.0.0: Distinguish Mustermann error hierarchy and exception types raised for malformed pattern syntax, invalid capture identifiers…

sha256:aaa0dba8bc057cb87c4fc9aba644a736d975024736c643655c77f03ab87944e3

このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。 合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。 MIT-0

実行証拠

宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。

証拠の基準
署名済みコントラクト合格
検証レシート
2
ビルドした署名鍵
1
宣言された環境 ruby linux x64 ruby ruby rubygems

検証実行環境

環境 コントラクト ステージ 実行日
ruby 3 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · rubygems@1
2026-08-16
ruby 3 · linux debian/x64 · docker ed25519:2175b912ea1c23b1 SKIPPED compile:SKIPPED · contract:SKIPPED · load:SKIPPED · resolve:FAIL
CONTAINER_RUN · rubygems@1
2026-08-18

ケース

HOW
ゴール
Distinguish Mustermann error hierarchy and exception types raised for malformed pattern syntax, invalid capture identifiers, anchored regexps, unsupported types, and missing expand parameters
パッケージ
シンボル
  • Mustermann.new
  • Mustermann::Error
  • Mustermann::CompileError
  • Mustermann::ParseError
  • Mustermann::ExpandError
  • Mustermann::Pattern#expand
  • Mustermann::Pattern#params
環境
ruby
作成日
2026-08-16T15:54:28Z

コントラクト

  1. Mustermann raises Mustermann::CompileError rather than Mustermann::ParseError when a pattern contains malformed capture names such as empty captures or leading digits, while unclosed groupings raise Mustermann::ParseError and expand with :ignore still raises Mustermann::ExpandError when required keys are missing.
  2. assert Mustermann.new('/foo/:') and Mustermann.new('/foo/:123') raise Mustermann::CompileError instead of Mustermann::ParseError
  3. assert Mustermann.new('/foo/(bar') and Mustermann.new('/foo/{bar') raise Mustermann::ParseError with unexpected token messages
  4. assert Mustermann.new('^/foo', type: :regexp) raises Mustermann::CompileError when anchor characters are present in regular expressions
  5. assert Mustermann.new('/foo', type: :unsupported_custom_type) raises ArgumentError rather than Mustermann::Error
  6. assert pattern.expand(:ignore, {}) raises Mustermann::ExpandError when required captures are missing because :ignore only applies to extra keys
  7. assert pattern.expand(:invalid_behavior, id: 1) raises ArgumentError rather than Mustermann::ExpandError
  8. assert Mustermann::CompileError, Mustermann::ParseError, and Mustermann::ExpandError all inherit from Mustermann::Error < StandardError

ファイル

  • Gemfile
  • NOTES.md
  • csx.json
  • test/contract.rb

ソースアーティファクトをダウンロード (tar.gz)

オリジンシーダー

csx-seed