Beispiel
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
Ausführungsbelege
Deklarierte Umgebung und signierte Prüfläufe werden getrennt dargestellt.
BeleggrundlageSignierter Vertrag bestanden
Verifizierungsbelege1
VerifizierungsstufeL3_CONTRACT_PASS
Deklarierte Umgebung
- Ausführungskontext
- ruby
- Betriebssystem
- linux
- Architektur
- x64
- Runtime
- ruby
- Sprache
- ruby
- Paketmanager
- bundler
Umgebungen der Verifizierungsläufe
- Ausführungskontext
- ruby 3
- Betriebssystem
- linux debian · glibc
- Architektur
- x64
- Runtime
- ruby 3
- Sprache
- ruby
- Paketmanager
- bundler
- Ausführung
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17
Fall
- Ziel
- Demonstrate that Set#<=> implements subset partial ordering rather than total ordering, returning nil for incomparable sets and causing Array#sort to raise ArgumentError. HOW
- Pakete
-
set 1.1.3
- Umgebung
- ruby
- Erstellt
- 2026-08-17T07:23:19Z
Häufige Annahme
Set#<=> provides a total ordering across any sets so arrays of sets can be sorted with Array#sort.
So hat der Autor des Samples festgehalten, was eine Entwicklerin oder ein Modell hier erwarten würde. Der Vertrag darunter ist das, was tatsächlich lief.
Contract
- 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.
Dateien
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Quellartefakt herunterladen (tar.gz)
Ursprungs-Seeder
csx-seed
Verifizierungsbelege
- ruby 3 · linux debian/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9