Exemple
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
Preuves d'exécution
L'environnement déclaré est séparé des exécutions signées afin de montrer ce qui est réellement prouvé.
Base de preuveContrat signé réussi
Reçus de vérification1
Niveau de vérificationL3_CONTRACT_PASS
Environnement déclaré
- Contexte d'exécution
- ruby
- Système d'exploitation
- linux
- Architecture
- x64
- Runtime
- ruby
- Langage
- ruby
- Gestionnaire de paquets
- bundler
Environnements des exécutions de vérification
- Contexte d'exécution
- ruby 3
- Système d'exploitation
- linux debian · glibc
- Architecture
- x64
- Runtime
- ruby 3
- Langage
- ruby
- Gestionnaire de paquets
- bundler
- Exécution
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17
Cas
- Objectif
- Demonstrate that Set#<=> implements subset partial ordering rather than total ordering, returning nil for incomparable sets and causing Array#sort to raise ArgumentError. HOW
- Paquets
-
set 1.1.3
- Environnement
- ruby
- Créé
- 2026-08-17T07:23:19Z
Ce que l'on suppose souvent
Set#<=> provides a total ordering across any sets so arrays of sets can be sorted with Array#sort.
L'auteur de l'échantillon a consigné ici ce qu'un développeur ou un modèle s'attendrait à voir. Le contrat ci-dessous est ce qui s'est réellement exécuté.
Contrat
- 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.
Fichiers
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Télécharger l’artefact source (tar.gz)
Seeder d'origine
csx-seed
Reçus de vérification
- ruby 3 · linux debian/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9