CodeSampleX

Ce que le réseau a trouvé

Chaque ligne ci-dessous est une mesure, pas un avis. Chacune renvoie à un échantillon publié dont le contract s'exécute dans un conteneur épinglé, réseau coupé : vous pouvez le rejouer et contredire le résultat.

Le système et le runtime viennent de l'environnement enregistré par l'échantillon ; les dimensions absentes sont exclues.

597 constats sur 8 écosystèmes.

Énoncé par l'échantillon, mesuré par son contrat

326–350 sur 568, mesurés par des échantillons publiés.

  1. pubContrat d'échantillondart · linux/x64equatable@2.1.0

    On croitA class extending Equatable automatically formats its fields in toString() output by iterating over its overridden props.

    Mesuréif (User('alice').toString() != 'User') throw 'toString defaults to just the class name, not the formatted props';

  2. pubContrat d'échantillondart · linux/x64equatable@2.1.0

    On croitExtending Equatable automatically includes instance properties in toString() output without requiring explicit configuration or debug assert flags.

    MesuréCalling toString() on an Equatable instance without explicit stringify overrides returns only the runtimeType string 'DefaultItem' rather than 'DefaultItem(a, 42)' when assertions are not enabled.

  3. pubContrat d'échantillondart · linux/x64equatable@2.0.8

    On croitEquatable evaluates two instances holding maps with different keys as non-equal even if all values in those maps are null.

    MesuréComparing Equatable objects containing maps with disjoint keys like {'keyA': null} and {'keyB': null} evaluates to false because missing keys are checked with containsKey rather than resolving to null.

  4. pubContrat d'échantillondart · linux/x64crypto@3.0.6

    On croitPassing integers outside 0..255 to Hash.convert raises an ArgumentError or RangeError on invalid byte values.

    Mesurésha256.convert([256, -1, 300]) raises no error and silently masks each integer to 8 bits, returning the exact same digest as sha256.convert([0, 255, 44]) rather than throwing an ArgumentError

  5. pubContrat d'échantillondart · linux/x64collection@1.19.1

    On croitbinarySearch returns the index of the first occurrence of the target element in the sorted list.

    Mesuréif (binarySearch(list, 2) != 3) throw 'binarySearch returns an arbitrary match (3) rather than the first occurrence (1)';

  6. pubContrat d'échantillondart · linux/x64crypto@3.0.7

    On croitA Digest constructed from a byte list is immutable and copies the backing list to prevent modification of its hash representation, and comparing two digests' bytes directly via the == operator checks for value equality.

    Mesuréassert that a Digest constructed with a mutable List holds that list by reference, so modifying the list externally alters the Digest's bytes, its hex string representation, and its hash code

  7. pubContrat d'échantillondart · linux/x64collection@1.19.0

    On croitCalling removeAll on a PriorityQueue empties the queue and returns all elements sorted in priority order.

    MesuréPriorityQueue.removeAll empties the queue and returns elements in unsorted internal binary heap storage order (yielding [5, 20, 10, 40, 50, 30] for elements [40, 10, 30, 20, 50, 5]) rather than priority order [5, 10, 20, 30, 40, 50], which requires repeatedly calling removeFirst.

  8. pubContrat d'échantillondart · linux/x64collection@1.18.0

    On croitSlicing a ListSlice of a ListSlice returns a sub-slice with elements offset by the sum of both slice start indices.

    MesuréSlicing a ListSlice of a ListSlice yields a sub-slice with the correct offset relative to the parent slice.

  9. pubContrat d'échantillondart · linux/x64collection@1.19.1

    On croitA priority queue should return the largest value first when no comparator is supplied.

    MesuréA `PriorityQueue` without a comparator argument is a min-heap, so `removeFirst()` returns 1 before 3 from [3, 1, 5].

  10. pubContrat d'échantillondart · linux/x64collection@1.19.1

    On croitAssigning a value to an invalid key on a CanonicalizedMap throws an ArgumentError, and putIfAbsent rejects invalid keys identically.

    MesuréCanonicalizedMap operator []= silently discards assignments for keys rejected by isValidKey without throwing an ArgumentError, leaving map length at 0 and containsKey returning false.

  11. pubContrat d'échantillondart · linux/x64collection@1.19.1

    On croitCalling cast on a CanonicalizedMap returns a valid Map wrapper that soundly checks and casts its keys and values for runtime lookups and iterations.

    MesuréCalling cast on a CanonicalizedMap returns a map view that throws a TypeError on value retrieval, because it delegates to the underlying map containing MapEntry elements instead of unpacking them.

  12. pubContrat d'échantillondart · linux/x64collection@1.19.0

    On croitCalling `mergeSort` with an explicit supertype, such as `mergeSort<num>`, should be treated as a normal typed call even when the argument is a `List<int>`.

    Mesuré`mergeSort<num>` on a `List<int>` completes without throwing and sorts the list in place.

  13. pubContrat d'échantillondart · linux/x64args@2.6.0

    On croitWhen an option expecting a value is immediately followed by a registered flag like --verbose, ArgParser.parse throws an ArgParserException for a missing option value and evaluates --verbose as a flag.

    MesuréArgParser.parse consumes an immediately following --verbose flag token as the literal string value of an option expecting a value, leaving the flag unparsed and false.

  14. pubContrat d'échantillondart · linux/x64args@2.4.2

    On croitOmitting a mandatory option when parsing command line arguments with ArgParser causes parse() to throw an ArgParserException during the parse call.

    MesuréArgParser.parse() in args 2.4.2 returns an ArgResults instance when a mandatory option is omitted, deferring mandatory validation failure to ArgResults operator [] access where it throws ArgumentError instead of throwing during parse() as in args 2.4.1.

  15. pubContrat d'échantillondart · linux/x64args@2.7.0

    On croitConcurrent invocations of CommandRunner.run maintain isolated argResults and globalResults bindings for each command execution across asynchronous await points.

    MesuréCalling CommandRunner.run concurrently while a command is awaiting an asynchronous operation overwrites Command.argResults and Command.globalResults mid-execution with the newly parsed values.

  16. pubContrat d'échantillondart · linux/x64args@2.7.0

    On croitA multi-option should keep each argument token as one string unless parsing rules are explicitly changed.

    MesuréArgParser.addMultiOption splits comma-separated values by default, so passing '--define env=prod,region=us-east' yields ['env=prod', 'region=us-east'] rather than the original single string.

  17. pubContrat d'échantillondart · linux/x64args@2.7.0

    On croitArgResults allows retrieving parsed option and flag values using either their canonical name or any configured alias.

    MesuréArgResults throws an ArgumentError when queried with an alias name via operator [] or wasParsed(), requiring all lookups to use the canonical option name regardless of how the option was supplied on the command line.

  18. pubContrat d'échantillondart · linux/x64args@2.7.0

    On croitArgParser.parse always throws an ArgParserException when a mandatory option is missing from the arguments.

    MesuréArgParser.parse does not throw an ArgParserException when a missing mandatory option has no callback, returning a successful ArgResults instead.

  19. pubContrat d'échantillondart · linux/x64args@2.7.0

    On croitWhen allowTrailingOptions is false, option-like arguments after the first positional argument still trigger validation, and the double-dash separator is consumed as a special token.

    MesuréDisabling allowTrailingOptions causes option-like arguments and the double-dash separator after a positional argument to be treated as literal positional arguments in results.rest rather than being parsed or consumed.

  20. npmContrat d'échantillonnode · linux/x64vue@3.5.41

    On croitReading a nested property from a shallowRef inside watchEffect makes that nested property reactive, so direct nested mutations rerun the effect.

    Mesuréassert directly mutating a nested property inside shallowRef does not rerun watchEffect even after the next scheduler tick

  21. npmContrat d'échantillonnode · linux/x64react-dom@18.3.1

    On croitrenderToPipeableStream returns a Node.js Readable stream or a Promise resolving to one, while renderToString throws when encountering suspended components

    MesurérenderToPipeableStream returns a synchronous { pipe, abort } controller object that is neither a Readable stream nor a Promise, where pipe(dest) returns the passed writable destination

  22. npmContrat d'échantillonnode · linux/x64puppeteer@24.43.1

    On croitCustom query handlers in Puppeteer can be registered globally via puppeteer.registerCustomQueryHandler with hyphenated or snake_case names.

    Mesurépuppeteer.registerCustomQueryHandler is undefined in Puppeteer v24 and custom query handlers must be registered via the named customQueryHandlers export using names matching only [a-zA-Z].

  23. npmContrat d'échantillonnode · linux/x64puppeteer@24.2.1

    On croitA CDPSession continues attempting raw protocol message dispatch when sent a command, even after its underlying connection is marked closed.

    MesuréIn puppeteer 24.2.1 compared to 24.2.0, calling send() on a CDPSession whose underlying CDP connection is closed immediately rejects with TargetCloseError.

  24. npmContrat d'échantillonnode · linux/x64marked@18.0.0

    On croitUnlike walkTokens which mutates tokens in-place without a return value, Marked's processAllTokens hook requires returning the modified token list.

    MesuréA processAllTokens hook that mutates tokens in-place without returning them causes Marked.parse to throw a TypeError: Cannot read properties of undefined (reading 'length'), whereas explicitly returning the modified token array permits successful rendering.

  25. npmContrat d'échantillonnode · linux/x64marked@18.0.6

    On croitAn ordered list starting with a number other than 1 cannot interrupt a blockquote and is instead parsed as a lazy continuation of the blockquote paragraph, matching standard paragraph interruption rules.

    MesuréAn ordered list starting with a number other than 1 that immediately follows a blockquote parses as a sibling ordered list rather than being nested inside the blockquote.

Comment vérifier n'importe quelle ligne

Ouvrez l'échantillon, lisez son contract, exécutez-le. Le contract est le test propre à l'échantillon : il tourne hors réseau dans un conteneur épinglé, et c'est le reçu signé de cette exécution que le réseau conserve. Rien ici ne repose sur notre lecture d'une bibliothèque, seulement sur ce qu'elle a fait.

Certains échantillons publiés ne figurent pas sur cette page. Leur contrat est passé et l'échantillon est en ligne, mais aucune ligne de ce contrat ne se lit comme une phrase. Une assertion comme expect(x).toBe(1), placée à côté de la croyance qu'elle vérifie, n'apprend rien au lecteur. Nous préférons les omettre plutôt que publier une preuve que personne ne peut lire.