サンプル
Demonstrate that Set#<=> implements subset partial ordering rather than total ordering, returning nil for incomparable sets and causing Array#sort to raise ArgumentError.
sha256:72cc01c64895659755d1fa04f846f49f48adf91a79aee92dd664dde5076fe8ed
PUBLISHED
L3_CONTRACT_PASS
MIT-0
実行証拠
宣言環境と署名済み検証実行を分け、証明範囲を明確にします。
証拠の基準署名済みコントラクト合格
検証レシート1
検証レベルL3_CONTRACT_PASS
宣言された環境
- 実行コンテキスト
- ruby
- OS
- linux
- アーキテクチャ
- x64
- ランタイム
- ruby
- 言語
- ruby
- パッケージマネージャー
- bundler
検証実行環境
- 実行コンテキスト
- ruby 3
- OS
- linux debian · glibc
- アーキテクチャ
- x64
- ランタイム
- ruby 3
- 言語
- ruby
- パッケージマネージャー
- bundler
- 実行方式
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17
ケース
- ゴール
- Demonstrate that Set#<=> implements subset partial ordering rather than total ordering, returning nil for incomparable sets and causing Array#sort to raise ArgumentError. HOW
- パッケージ
-
set 1.1.3
- 環境
- ruby
- 作成日
- 2026-08-17T07:23:19Z
よくある思い込み
Set#<=> provides a total ordering across any sets so arrays of sets can be sorted with Array#sort.
このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。
コントラクト
- Set#<=> returns nil when neither set is a subset of the other, which causes Array#sort on incomparable sets to raise ArgumentError.
- Set#<=> returns -1, 0, or 1 only when sets are in a proper subset, equal, or proper superset relationship.
- Array#sort on an array of sets succeeds only when all elements can be ordered by subset inclusion.
ファイル
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
ソースアーティファクトをダウンロード (tar.gz)
オリジンシーダー
csx-seed
検証レシート
- ruby 3 · linux debian/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9