awesome-repositories.com
Blog
awesome-repositories.com

Descoperă cele mai bune repository-uri open source cu căutare AI.

ExploreazăCăutări recomandateAlternative open-sourceSoftware self-hostedBlogHartă site
ProiectDespreCum realizăm clasamentulPresăServer MCP
LegalConfidențialitateTermeni
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
google avatar

google/go-cmp

0
View on GitHub↗
4,651 stele·224 fork-uri·Go·BSD-3-Clause·2 vizualizări

Go Cmp

go-cmp este o bibliotecă de comparare a valorilor pentru Go, concepută pentru utilizarea în suitele de testare. Funcționează ca un instrument recursiv de diferențiere a datelor și de aserțiune care determină dacă două structuri de date complexe sunt egal semantic, în loc să se bazeze pe egalitatea strictă la nivel de biți.

Biblioteca oferă un framework pentru definirea logicii de comparare specializate, permițând utilizatorilor să înregistreze override-uri de egalitate personalizate pentru tipuri specifice. Include mecanisme pentru a gestiona modul în care câmpurile neexportate sunt tratate în timpul traversării pentru a preveni erorile de runtime în timpul verificărilor de egalitate profundă.

Sistemul utilizează traversarea valorilor bazată pe reflexie pentru a identifica neconcordanțele specifice între valorile așteptate și cele reale, producând diferențe detaliate atunci când valorile nu se potrivesc. Suportă dispatch-ul egalității specific tipului și comportamentul de comparare configurabil.

Features

  • Recursive Semantic Equality - Determines if two complex data structures are semantically equal by recursively comparing their components.
  • Reflection-Based Comparison - Uses Go reflection to recursively walk through complex data structures for deep equality checks.
  • Equality Logic Frameworks - Provides a configurable framework for implementing specialized comparison logic and handling unexported fields.
  • Unexported Field Access Control - Manages reflection access to unexported fields to prevent runtime panics during deep equality checks.
  • Comparison Logic Overrides - Provides a framework for registering custom functions to replace default equality logic for specific types.
  • Custom Equality Definitions - Allows the definition of custom comparison functions to handle special cases like floating-point tolerances.
  • Recursive Data Diffing - Traverses Go types recursively to identify and produce detailed mismatches between expected and actual values.
  • Semantic Value Comparison - Determines if two values are semantically equal by recursively comparing primitive types or applying specialized logic.
  • Go Testing Frameworks - Serves as a specialized assertion tool for Go that generates detailed diffs between expected and actual values.
  • Private Field Comparison Controls - Provides capabilities to manage whether unexported fields are included in value comparisons during testing.
  • Unexported Field Handling - Manages how private struct fields are treated during comparison to prevent panics in Go test suites.
  • Value Comparison Libraries - Compares complex Go data structures in tests using semantic equality instead of strict bitwise equality.
  • Object Equality Implementations - Supports defining specific equality methods on types to control how their equality is calculated.
  • Special Type Equality Handlers - Routes comparison logic to special handlers based on the concrete type of the values.
  • Functional Options - Implements the functional options pattern to configure complex comparison settings via variadic functions.
  • Custom Assertions - Enables specialized equality rules for types to handle business logic or floating point precision during verification.
  • Unit Testing - Facilitates the verification of complex data structures within Go unit tests.
  • Testing and QA - Package for comparing Go values in tests.
  • Testing and Quality Assurance - Package for deep comparison of Go values.
  • Framework-uri de testare - Package for comparing Go values in tests.

Istoric stele

Graficul istoricului de stele pentru google/go-cmpGraficul istoricului de stele pentru google/go-cmp

Căutare AI

Explorează mai multe repository-uri excelente

Descrie ce ai nevoie în limbaj simplu — AI-ul sortează mii de proiecte open source selectate în funcție de relevanță.

Start searching with AI

Alternative open-source pentru Go Cmp

Proiecte open-source similare, clasificate după numărul de funcționalități comune cu Go Cmp.
  • smartystreets/goconveyAvatar smartystreets

    smartystreets/goconvey

    8,415Vezi pe GitHub↗

    GoConvey is a behavioral testing framework for the Go programming language that provides a test runner, a code coverage tool, and a web-based monitoring dashboard. It integrates with the standard Go test command to organize tests into behavioral stories and conveyors. The project features a web interface that monitors the file system for source code changes and automatically triggers test execution to provide real-time feedback. This dashboard displays test results, failures, and a chronological history of execution status. The framework includes a state assertion system for verifying values

    Go
    Vezi pe GitHub↗8,415
  • chaijs/chaiAvatar chaijs

    chaijs/chai

    8,264Vezi pe GitHub↗

    Chai is an assertion library for Node.js and browser-based JavaScript applications. It functions as both a behavior-driven development and test-driven development framework, providing a system to verify code outputs, application state, and general logic. The project is an extensible validation engine that uses a plugin-based system to allow the registration of custom assertions and specialized data checks. It supports multiple modular assertion styles to accommodate different validation philosophies. The library covers a broad range of data validation capabilities, including the inspection o

    JavaScript
    Vezi pe GitHub↗8,264
  • sinonjs/sinonAvatar sinonjs

    sinonjs/sinon

    9,753Vezi pe GitHub↗

    Sinon is a JavaScript test double library and mocking framework used to isolate code and verify behavior during unit testing. It provides a collection of spies, stubs, and mocks that replace real function implementations and object methods with controlled substitutes. The project includes a specialized fake timer library for overriding the system clock, allowing the simulation of time progression to trigger timeouts and intervals without waiting for real-time delays. It also features a test sandbox mechanism to group multiple fakes together, ensuring the original state is restored between tes

    JavaScript
    Vezi pe GitHub↗9,753
  • bradleyjkemp/cupaloyB

    bradleyjkemp/cupaloy

    0Vezi pe GitHub↗
    Vezi pe GitHub↗0
Vezi toate cele 30 alternative pentru Go Cmp→

Întrebări frecvente

Ce face google/go-cmp?

go-cmp este o bibliotecă de comparare a valorilor pentru Go, concepută pentru utilizarea în suitele de testare. Funcționează ca un instrument recursiv de diferențiere a datelor și de aserțiune care determină dacă două structuri de date complexe sunt egal semantic, în loc să se bazeze pe egalitatea strictă la nivel de biți.

Care sunt principalele funcționalități ale google/go-cmp?

Principalele funcționalități ale google/go-cmp sunt: Recursive Semantic Equality, Reflection-Based Comparison, Equality Logic Frameworks, Unexported Field Access Control, Comparison Logic Overrides, Custom Equality Definitions, Recursive Data Diffing, Semantic Value Comparison.

Care sunt câteva alternative open-source pentru google/go-cmp?

Alternativele open-source pentru google/go-cmp includ: smartystreets/goconvey — GoConvey is a behavioral testing framework for the Go programming language that provides a test runner, a code… chaijs/chai — Chai is an assertion library for Node.js and browser-based JavaScript applications. It functions as both a… sinonjs/sinon — Sinon is a JavaScript test double library and mocking framework used to isolate code and verify behavior during unit… appleboy/gofight. adamluzsi/testcase. bradleyjkemp/cupaloy.