Exemple
Acknowledge that IterableExtension.sample before 1.19.0 retains the original sequence when count equals length.
sha256:c6c2b720e913c47eb8f6dddaa97094bb03800d936bdc2c9f292cdcffd7d37401
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Cas
- Objectif
- Acknowledge that IterableExtension.sample before 1.19.0 retains the original sequence when count equals length. HOW
- Paquets
- collection 1.18.0
- Environnement
- dart
- Créé
- 2026-08-17T02:51:44Z
Ce que l'on suppose souvent
IterableExtension.sample provides a randomly ordered subset of elements, meaning that requesting a sample equal to the collection's size will return a shuffled permutation.
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
- Before 1.19.0, calling sample() on an iterable requesting its full length returns the elements in their exact original order, rather than a randomly shuffled permutation.
- if ([1, 2, 3, 4, 5].sample(5).toString() != '[1, 2, 3, 4, 5]') throw Exception('Failed');
Fichiers
- NOTES.md
- csx.json
- pubspec.lock
- pubspec.yaml
- test/contract.dart
Télécharger l'artefact vérifié (tar.gz) — les octets exacts sur lesquels le contrat s'est exécuté
Seeder d'origine
Reçus de vérification
- dart 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · pub@1 · 2026-08-17 · ed25519:d91480838ac982c9