CodeSampleX

Was das Netzwerk gefunden hat

Jede Zeile hier ist eine Messung, keine Meinung. Jede verweist auf ein veröffentlichtes Sample, dessen Contract in einem gepinnten Container ohne Netzzugang ausgeführt wird — Sie können ihn erneut ausführen und dem Ergebnis widersprechen.

Betriebssystem und Runtime stammen aus der aufgezeichneten Sample-Umgebung; fehlende Dimensionen werden ausgeschlossen.

597 Befunde aus 8 Ökosystemen.

Vom Sample behauptet, vom Vertrag gemessen

401–425 von 568, gemessen von veröffentlichten Samples.

  1. golangSample-Vertraggo · linux/x64github.com/go-chi/chi/v5@v5.3.1

    Angenommenapplying path-modifying middleware like StripSlashes per-route with r.With() strips trailing slashes for that specific route and serves a 200 OK response

    Gemessenassert per-route With(StripSlashes) fails with 404 on trailing slash requests because tree matching precedes route middleware

  2. golangSample-Vertraggo · linux/x64github.com/go-chi/chi/v5@v5.2.5

    AngenommenIf no routes are configured on `middleware.RouteHeaders`, the wrapped request flow is inert and should skip calling the downstream handler.

    Gemessen`middleware.RouteHeaders().Handler` with an empty router must call the wrapped handler exactly once.

  3. golangSample-Vertraggo 1.26 · linux/x64github.com/go-chi/chi/v5@v5.3.1

    AngenommenA request using an unregistered HTTP method is handled by NotFound in the same way as a request for an unknown path.

    Gemessenchi.Mux.Get routes GET /widgets to the registered handler with status 200, Content-Type application/json, and body {"widgets":[]} followed by a newline.

  4. gemSample-Vertragruby · linux/x64zeitwerk@2.8.3

    AngenommenCalling loader.reload reloads modified source files by default, and reloading can be enabled at any point in the loader lifecycle after setup.

    GemessenCalling loader.reload raises Zeitwerk::ReloadingDisabledError by default because reloading is disabled out of the box in major version 2, requiring an explicit loader.enable_reloading call before setup.

  5. gemSample-Vertragruby · linux/x64zeitwerk@2.8.3

    AngenommenCalling loader.unload completely tears down a Zeitwerk loader and releases its root directories for re-use by new loaders or for garbage collection.

    Gemessenassert calling loader.unload clears constants and autoloads but retains the loader in Zeitwerk::Registry.loaders and Zeitwerk::Loader.all_dirs, blocking any new loader from managing that root directory with Zeitwerk::Error until loader.unregister is explicitly called

  6. gemSample-Vertragruby · linux/x64zeitwerk@2.8.3

    AngenommenCalling loader.reload on a configured Zeitwerk autoloader unloads and refreshes constants without requiring opt-in configuration before setup, or reloading can be enabled at runtime whenever code changes occur.

    Gemessenassert calling loader.reload on a default loader raises Zeitwerk::ReloadingDisabledError because reloading is disabled by default and loader.enable_reloading must be called before setup, whereas calling enable_reloading after setup raises Zeitwerk::Error

  7. gemSample-Vertragruby · linux/x64zeitwerk@2.8.3

    AngenommenA model might expect reloading to be a runtime setting, so enabling it after setup should allow reload to work and unloading should always clear loaded constants.

    GemessenCalling reload before enable_reloading raises Zeitwerk::ReloadingDisabledError, even after setup succeeds and autoloads are installed

  8. gemSample-Vertragruby · linux/x64zeitwerk@2.8.3

    Angenommenloader.collapse strips all directory nesting within the target directory so nested files define top-level constants in the parent namespace

    Gemessenassert loader.collapse removes only the collapsed directory from constant paths so files in subdirectories define namespaced constants (e.g. concerns/oauth/token.rb defines Oauth::Token) rather than flattening the entire subtree into the parent namespace (Token)

  9. gemSample-Vertragruby · linux/x64sinatra@4.2.1

    AngenommenReturning a Ruby Hash from a Sinatra route block either serializes to JSON or raises a type error, and returning a two-element array of a status integer and a hash sets the response status and headers.

    Gemessenassert a bare Hash returned from a route is treated as an Enumerable body yielding key-value array pairs with text/html rather than serializing to JSON

  10. gemSample-Vertragruby · linux/x64sinatra@4.2.1

    AngenommenRaising a custom exception in a route is handled by its error block in development mode while unhandled exceptions return 500 in test mode, halt bodies are never replaced by status handlers, and returning a Symbol or Integer sets the body or status identically to the status helper.

    Gemessenassert in development mode default show_exceptions intercepts custom exceptions with an HTML backtrace rather than running the error handler

  11. gemSample-Vertragruby · linux/x64mustermann@4.0.0

    AngenommenA wildcard capture that has no characters before the next separator is absent, so a capture like `path` should be nil.

    GemessenA trailing slash on a wildcard route match yields an empty string capture rather than an absent nil value.

  12. gemSample-Vertragruby · linux/x64json@2.9.1

    AngenommenA Hash with keys 1 and '1' should preserve both entries after a round-trip because the two keys are different in Ruby.

    GemessenJSON.generate turns both the integer key 1 and string key '1' into a duplicate JSON member name '1', so it emits two members but the parser can no longer distinguish the originals.

  13. gemSample-Vertragruby · linux/x64faraday-net_http@3.4.4

    AngenommenA confident model expects multiple requests inside a Net::HTTP Faraday `in_parallel` block to be dispatched concurrently.

    GemessenIn `in_parallel`, the second request starts at or after the first request has finished, showing that this adapter does not actually execute requests in parallel.

  14. gemSample-Vertragruby · linux/x64faraday-net_http@3.4.4

    AngenommenFaraday's NetHttp adapter accurately extracts quoted MIME charset parameters to transcode response bodies, preserves nil for empty 204 bodies, and automatically stringifies non-string header values.

    Gemessenassert Faraday NetHttp adapter falls back to Encoding::ASCII_8BIT when Content-Type contains a quoted charset parameter (such as charset=\"iso-8859-1\") rather than setting the parsed encoding

  15. gemSample-Vertragruby · linux/x64faraday-net_http@3.4.4

    AngenommenSetting `ssl.verify = false` for an HTTPS Faraday request is expected to also disable Net::HTTP hostname verification.

    GemessenA `verify: false` TLS option only changes `verify_mode`; Faraday only sets `verify_hostname` when `verify_hostname` is explicitly passed in SSL options.

  16. composerSample-Vertragphp 8.5 · linux/x64symfony/http-foundation@8.1.4

    AngenommenRequest::getPayload() follows Content-Type and merges all request inputs, while passing an already encoded JSON string to JsonResponse sends that document unchanged.

    Gemessenassert Request::getPayload prefers a non-empty parsed form bag over query and raw JSON, returns a defensive InputBag clone, and InputBag::get rejects nested values that InputBag::all retrieves

  17. composerSample-Vertragphp · linux/x64symfony/console@8.1.4

    AngenommenA model may expect an omitted `InputOption::VALUE_NEGATABLE` option to be returned as `false`.

    GemessenWhen a command with `InputOption::VALUE_NEGATABLE` is executed without passing that option, `InputInterface::getOption` returns `null`.

  18. cargoSample-Vertragrust · linux/x64sqlx@0.8.6

    AngenommenDeclaring a struct field as Option<T> allows sqlx::FromRow to decode as None when the column is omitted from the SQL query projection.

    GemessenOmitting an Option<T> column from a SELECT query causes FromRow to fail with ColumnNotFound instead of decoding as None

  19. cargoSample-Vertragrust · linux/x64tracing@0.1.44

    AngenommenA subscriber installed with with_default is often assumed to compose with an existing default and propagate to threads spawned inside its closure.

    Gemessenassert Span::record updates a field declared with tracing::field::Empty and the event observes the entered span scope

  20. cargoSample-Vertragrust · linux/x64tower-layer@0.3.3

    AngenommenA competent developer would expect a shared `&Layer` to behave like independent applications and not accumulate per-wrap side effects when reused.

    Gemessenassert that the same borrowed layer can be used for multiple `Layer::layer` calls and the call count is cumulative

  21. cargoSample-Vertragrust · linux/x64reqwest@0.13.4

    AngenommenPolicy::limited(0) is equivalent to Policy::none(), and a custom redirect attempt's previous list excludes the initial request URL.

    GemessenPolicy::none returns the original 302 response without treating the redirect as an error

  22. npmSample-Vertragnode · linux/x64marked@18.0.9

    AngenommenCustom renderer methods in marked receive positional primitive arguments like heading(text, level) and link(href, title, text) with child tokens pre-rendered into HTML strings.

    GemessenOverriding a custom renderer method with legacy positional parameters like heading(text, level) passes the AST token object as the first parameter and undefined as the second, silently rendering undefined and object Object in place of tag attributes and text

  23. npmSample-Vertragnode · linux/x64luxon@3.5.0

    AngenommenParsing an invalid ISO date string or out-of-range calendar date in Luxon throws an Error or rolls over to a valid date.

    GemessenDateTime.fromISO with an unparsable string or impossible calendar date does not throw and does not roll over, returning an invalid DateTime object with isValid false and toISO null

  24. npmSample-Vertragnode · linux/x64luxon@3.7.2

    AngenommenA correct `luxon` package with an ESM entry point allows `import { DateTime } from "luxon"` to execute normally from ES module code.

    GemessenImporting `luxon` through a named ESM import from `node_modules` returns a usable `DateTime` export.

  25. npmSample-Vertragnode · linux/x64core-js@3.40.0

    AngenommenObject.groupBy returns a plain Object instance inheriting from Object.prototype with standard methods such as toString and hasOwnProperty.

    GemessenObject.groupBy returns an object with a null prototype rather than Object.prototype, making instanceof Object evaluate to false and omitting standard methods like toString.

Wie Sie jede Zeile hier prüfen

Öffnen Sie das Sample, lesen Sie seinen Contract, führen Sie ihn aus. Der Contract ist der eigene Test des Samples: Er läuft ohne Netz in einem gepinnten Container, und die signierte Quittung dieses Laufs ist das, was das Netzwerk speichert. Nichts hier hängt davon ab, wie wir eine Bibliothek lesen — nur davon, was sie getan hat.

Einige veröffentlichte Beispiele stehen nicht auf dieser Seite. Ihr Vertrag ist bestanden und das Beispiel ist live — aber keine Zeile dieses Vertrags liest sich als Satz. Eine Zusicherung wie expect(x).toBe(1) sagt neben der Annahme, die sie prüft, niemandem etwas. Sie bleiben lieber draußen, als als Beleg zu erscheinen, den niemand lesen kann.