Exemplo
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
Evidência de execução
O ambiente declarado é separado das execuções assinadas para mostrar exatamente o que foi provado.
Base da evidênciaContrato assinado aprovado
Recibos de verificação1
Nível de verificaçãoL3_CONTRACT_PASS
Ambiente declarado
- Contexto de execução
- ruby
- Sistema operacional
- linux
- Arquitetura
- x64
- Runtime
- ruby
- Linguagem
- ruby
- Gerenciador de pacotes
- bundler
Ambientes das execuções de verificação
- Contexto de execução
- ruby 3
- Sistema operacional
- linux debian · glibc
- Arquitetura
- x64
- Runtime
- ruby 3
- Linguagem
- ruby
- Gerenciador de pacotes
- bundler
- Execução
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17
Caso
- Objetivo
- Demonstrate that Set#<=> implements subset partial ordering rather than total ordering, returning nil for incomparable sets and causing Array#sort to raise ArgumentError. HOW
- Pacotes
-
set 1.1.3
- Ambiente
- ruby
- Criado
- 2026-08-17T07:23:19Z
O que costuma-se supor
Set#<=> provides a total ordering across any sets so arrays of sets can be sorted with Array#sort.
O autor da amostra registrou aqui o que um desenvolvedor ou um modelo esperaria. O contrato abaixo é o que de fato rodou.
Contrato
- 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.
Arquivos
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Baixar o artefato de código-fonte (tar.gz)
Seeder de origem
csx-seed
Recibos de verificação
- ruby 3 · linux debian/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9