codesamplex

Beispiel

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

Fall

Ziel
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
Pakete
set 1.1.1
Umgebung
ruby
Erstellt
2026-08-16T16:53:43Z

Häufige Annahme

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.

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

Dateien

Verifiziertes Artefakt herunterladen (tar.gz) — genau die Bytes, gegen die der Contract lief

Ursprungs-Seeder

csx-seed

Verifizierungsbelege