codesamplex

Exemple

Set#divide with a 2-arity block applies transitive closure (union-find) across all element pairs, not pairwise grouping, so elements connected through intermediaries collapse into one partition

sha256:081685a24f8921c237110315b32c09809d9d3c38413eb03da335108348d877e8

PUBLISHED L3_CONTRACT_PASS MIT-0

Cas

Objectif
Set#divide with a 2-arity block applies transitive closure (union-find) across all element pairs, not pairwise grouping, so elements connected through intermediaries collapse into one partition HOW
Paquets
set 1.1.1
Environnement
ruby
Créé
2026-08-16T16:53:43Z

Ce que l'on suppose souvent

Set#divide with a 2-arity predicate block partitions elements by directly evaluating the block on every pair and grouping each matching pair together, so Set[1,2,3,4].divide { |a,b| (a-b).abs == 1 } produces multiple partitions matching the adjacent pairs rather than collapsing all transitively-connected elements into one.

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

Fichiers

Télécharger l'artefact vérifié (tar.gz) — les octets exacts sur lesquels le contrat s'est exécuté

Seeder d'origine

csx-seed

Reçus de vérification