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

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

  1. npmContrat d'échantillonnode · linux/x64react-dom@19.0.0

    On croitreact-dom/server strips functions passed to form action and button formAction props during server-side rendering like standard event handlers, leaving form submission to native browser HTTP request defaults.

    MesuréPassing a function to form action or button formAction in react-dom/server emits a javascript:throw error URL and injects an inline submit listener replay script

  2. golangContrat d'échantillongo · linux/x64gorm.io/gorm@v1.31.2

    On croitWhen `gorm.G[T]` is used with `Set(...)` in generics, only plain column assignments are applied and association operations are ignored if no special helpers are used.

    Mesuréassert that `gorm.G[User](db).Where("id = ?", user.ID).Set(clause.Association{Association:"Languages",Type:clause.OpUpdate,Set:...,Conditions:...}).Update(ctx)` mutates only the related `languages.name` row for `code = 'en'`

  3. composerContrat d'échantillonphp · linux/x64guzzlehttp/guzzle@7.15.3

    On croitGuzzleHttp\Client::sendRequest follows redirects and throws ClientException on 4xx responses identically to send under default client options.

    MesuréPSR-18 sendRequest returns 4xx and 5xx status codes as valid ResponseInterface instances without throwing ClientException even when http_errors is enabled by default

  4. golangContrat d'échantillongo · linux/x64github.com/spf13/viper@v1.21.0

    On croitA `Sub()` call drops a custom key delimiter to the default delimiter, so a value set under `service::db::host` cannot be read from `sub.GetString("db::host")`.

    MesuréWhen delimiter-specific lookup on the sub-tree works, it proves `Sub()` preserved lookup behavior instead of silently falling back to parentless key parsing.

  5. composerContrat d'échantillonphp · linux/x64symfony/console@8.1.4

    On croitA caller expects a missing `InputOption::VALUE_NEGATABLE` to evaluate as `false`.

    MesuréRunning a command with only `addOption('cache', null, InputOption::VALUE_NEGATABLE, ...)` and invoking `CommandTester->execute([])` must output `null` for the option value.

  6. golangContrat d'échantillongo · linux/x64github.com/spf13/pflag@v1.0.10

    On croitA wrapped ErrHelp value from a flag setter should still be treated as a help request and exit with code 0.

    MesuréWith ErrorHandling=ExitOnError, FlagSet.Parse returns a wrapped ErrHelp via Set() and exits with status 2, not 0.

  7. golangContrat d'échantillongo · linux/x64github.com/spf13/pflag@v1.0.10

    On croita flag with NoOptDefVal set binds a subsequent space-separated argument as its value during command-line parsing

    Mesuréfs.Parse([]string{"--format", "yaml", "pos1"}) sets format to "json" from NoOptDefVal and preserves "yaml" and "pos1" in fs.Args()

  8. golangContrat d'échantillongo · linux/x64golang.org/x/sync@v0.22.0

    On croitsingleflight.Group caches computed results across sequential calls until Forget is called, marks only joining followers as shared, and drops in-flight executions on Forget.

    Mesuréassert singleflight.Group executes sequential calls repeatedly without caching and does not require Forget to invalidate

  9. pypiContrat d'échantillonpython · linux/x64zipp@4.1.0

    On croitDirectly instantiating zipp.Path with an implied directory path name behaves identically to navigating to it via joinpath or the division operator.

    Mesuréassert not Path(zf).exists() and Path(zf).is_dir() at the archive root

  10. pubContrat d'échantillondart · linux/x64shelf@1.4.2

    On croitA shelf Request's url property is an absolute Uri whose path starts with a leading slash matching requestedUri.path, and change(path:) appends subpaths.

    Mesuréassert request.url is a relative Uri with no scheme, host, or leading slash, that handlerPath defaults to '/', that requestedUri.path equals handlerPath + url.path, that change(path:) consumes path segments from url.path into handlerPath rather than appending, that change(path:) with a leading slash or unmatched prefix throws ArgumentError, and that Request constructor rejects a non-empty handlerPath missing a trailing slash

  11. npmContrat d'échantillonnode · linux/x64socket.io-client@4.8.3

    On croitPassing a URL pathname to io() sets the HTTP request path on the server and opens an independent transport connection per namespace, while auth options are sent in HTTP handshake headers or query parameters.

    Mesuréassert io() parses URL pathname as socket namespace and routes HTTP requests to /socket.io/ rather than URL path unless path option is explicitly set

  12. golangContrat d'échantillongo · linux/x64github.com/google/go-cmp@v0.7.0

    On croitPassing an outer struct to cmpopts.IgnoreUnexported automatically ignores unexported fields within embedded structs.

    Mesuréassert cmpopts.IgnoreUnexported on an outer struct panics when comparing embedded structs with unexported fields

  13. npmContrat d'échantillonnode · linux/x64jsonwebtoken@9.0.3

    On croitjwt.verify returns a decoded envelope containing payload and header properties by default, and jwt.sign merges payload registered claims with signing options.

    Mesuréassert jwt.verify with complete: true returns an envelope containing header, payload, and signature

  14. golangContrat d'échantillongo · linux/x64net/http@go1.26.5

    On croitA common model expectation is that once headers arrive, a `http.Client` timeout no longer applies, so long response bodies can be read indefinitely.

    MesuréA request with a short `Client.Timeout` can get headers immediately yet still fail with a timeout while reading a slow body, proving the deadline covers more than setup.

  15. golangContrat d'échantillongo · linux/x64embed@v1.26.5

    On croitPassing "/assets/hello.txt" to embed.FS.Open should open the same embedded file as "assets/hello.txt".

    Mesuréassert embed.FS.Open("/assets/hello.txt") fails even though it names an existing embedded path with a leading slash

  16. cargoContrat d'échantillonrust · linux/x64tower-layer@0.3.3

    On croitStack::new(a, b) establishes a middleware pipeline where layer a executes before layer b on incoming requests, matching left-to-right argument order and tuple composition

    MesuréStack::new(layer_a, layer_b).layer(base) wraps base with layer_a first and layer_b second, executing layer_b before layer_a on incoming requests

  17. cargoContrat d'échantillonrust · linux/x64tower-service@0.3.3

    On croitCalling Service::call borrows &mut self for the entire lifetime of the returned Future, preventing a single unbuffered service instance from polling and dispatching subsequent requests while a prior request is in flight.

    MesuréPassing a mutable reference &mut S into a generic Service consumer yields S::Future without tying the future to the &mut borrow lifetime, allowing immediate re-borrowing to poll and dispatch subsequent requests while earlier futures remain in flight

  18. cargoContrat d'échantillonrust · linux/x64sqlx@0.8.6

    On croitA value larger than `i32::MAX` can still be decoded into `i32`, with SQLite-like truncation happening behind the scenes.

    Mesuréassert that reading a SQLite `INTEGER` value greater than `i32::MAX` into `i32` returns an error

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.