diff --git a/docs/doc-site/_index.md b/docs/doc-site/_index.md index 62c9a7a92..f500607da 100644 --- a/docs/doc-site/_index.md +++ b/docs/doc-site/_index.md @@ -1,7 +1,7 @@ --- title: "Testify v2" type: home -description: 'The v2 our test wanted' +description: 'The v2 our tests wanted' weight: 1 --- @@ -167,4 +167,4 @@ See also our [CONTRIBUTING guidelines](./project/contributing/CONTRIBUTING.md). {{< children type="card" description="true" >}} -[doc-examples]: ./usage/examples +[doc-examples]: ./usage/EXAMPLES.md diff --git a/docs/doc-site/api/_index.md b/docs/doc-site/api/_index.md index f0d2179e0..620926b7f 100644 --- a/docs/doc-site/api/_index.md +++ b/docs/doc-site/api/_index.md @@ -45,7 +45,7 @@ Each domain contains assertions regrouped by their use case (e.g. http, json, er - [Ordering](./ordering.md) - Asserting How Collections Are Ordered (10) - [Panic](./panic.md) - Asserting A Panic Behavior (4) - [String](./string.md) - Asserting Strings (4) -- [Testing](./testing.md) - Mimicks Methods From The Testing Standard Library (2) +- [Testing](./testing.md) - Mimics Methods From The Testing Standard Library (2) - [Time](./time.md) - Asserting Times And Durations (2) - [Type](./type.md) - Asserting Types Rather Than Values (10) - [Yaml](./yaml.md) - Asserting Yaml Documents (3) diff --git a/docs/doc-site/api/testing.md b/docs/doc-site/api/testing.md index 605e1850b..52f5cd5ea 100644 --- a/docs/doc-site/api/testing.md +++ b/docs/doc-site/api/testing.md @@ -1,6 +1,6 @@ --- title: "Testing" -description: "Mimicks Methods From The Testing Standard Library" +description: "Mimics Methods From The Testing Standard Library" modified: 2026-01-27 weight: 14 domains: @@ -12,7 +12,7 @@ keywords: - "FailNowf" --- -Mimicks Methods From The Testing Standard Library +Mimics Methods From The Testing Standard Library ## Assertions diff --git a/docs/doc-site/project/APPROACH.md b/docs/doc-site/project/APPROACH.md index 4330920bb..51bfaa7ed 100644 --- a/docs/doc-site/project/APPROACH.md +++ b/docs/doc-site/project/APPROACH.md @@ -372,7 +372,7 @@ standards, then **assertion-style testing is the natural extension of those valu BDD frameworks serve teams with different priorities (narrative specifications, framework-managed workflows, stakeholder communication). Those are valid priorities. But they optimize for values orthogonal to Go's design philosophy. -For such teams, **Ginkgo/Omega** provides a great BDD testing framework. +For such teams, **Ginkgo/Gomega** provides a great BDD testing framework. **For Go developers who embrace Go values, assertion-style testing is the idiomatic approach.**. And **testify** is the tool. diff --git a/docs/doc-site/project/MOTIVATION.md b/docs/doc-site/project/MOTIVATION.md index f0023ca7b..34c77598c 100644 --- a/docs/doc-site/project/MOTIVATION.md +++ b/docs/doc-site/project/MOTIVATION.md @@ -29,7 +29,7 @@ APIs that became bloated over a decade or so, uncontrolled dependencies, difficu breaking changes, conflicting demands from users etc. {{% /notice %}} -You might also be curious about our [ROADMAP](project/maintainers/ROADMAP.md). +You might also be curious about our [ROADMAP](./maintainers/ROADMAP.md). --- diff --git a/docs/doc-site/usage/CHANGES.md b/docs/doc-site/usage/CHANGES.md index 186546480..866327396 100644 --- a/docs/doc-site/usage/CHANGES.md +++ b/docs/doc-site/usage/CHANGES.md @@ -171,7 +171,7 @@ See also a quick [migration guide](./MIGRATION.md). **Origin**: Generic initiative + [#1685] (partial - SeqContains variants only) -**Performance**: 16-81x faster than reflection-based variants (see [benchmarks](../../project/maintainers/BENCHMARKS.md)) +**Performance**: 16-81x faster than reflection-based variants (see [benchmarks](../project/maintainers/BENCHMARKS.md)) [#1685]: https://github.com/stretchr/testify/pull/1685 {{% /expand %}} @@ -464,7 +464,7 @@ Removed extraneous type declaration `PanicTestFunc` (`func()`). ### Performance Improvements -See [Performance Benchmarks](../../project/maintainers/BENCHMARKS.md) for a detailed presentation. +See [Performance Benchmarks](../project/maintainers/BENCHMARKS.md) for a detailed presentation. #### Generic vs Reflection Performance @@ -532,7 +532,7 @@ github.com/go-openapi/testify/v2 # Core (zero deps) [go.mod] | **Generated functions** | ~600 (76 × 8 variants - generics get 4 variants only) | | **Generic coverage** | 10 domains | | **Performance improvement** | 1.2x to 81x faster | -| **Dependencies** | 0 external (was 2 requiredl) | +| **Dependencies** | 0 external (was 2 required) | | **Test coverage** | 96% overall, 100% on public APIs | | **Documentation domains** | 18 logical categories | @@ -542,7 +542,7 @@ github.com/go-openapi/testify/v2 # Core (zero deps) [go.mod] - [Migration Guide](./MIGRATION.md) - Step-by-step guide to migrating from testify v1 - [Generics Guide](./GENERICS.md) - Detailed documentation of all 38 generic assertions -- [Performance Benchmarks](../../project/maintainers/BENCHMARKS.md) - Comprehensive performance analysis +- [Performance Benchmarks](../project/maintainers/BENCHMARKS.md) - Comprehensive performance analysis - [Examples](./EXAMPLES.md) - Practical usage examples showing new features - [Tutorial](./TUTORIAL.md) - Best practices for writing tests with testify v2 - [API Reference](../api/_index.md) - Complete assertion catalog organized by domain diff --git a/docs/doc-site/usage/EXAMPLES.md b/docs/doc-site/usage/EXAMPLES.md index eb3f37969..b9ec83e0a 100644 --- a/docs/doc-site/usage/EXAMPLES.md +++ b/docs/doc-site/usage/EXAMPLES.md @@ -35,7 +35,7 @@ func TestCalculator(t *testing.T) { import ( "testing" - "github.com/stretchr/testify/assert" + "github.com/go-openapi/testify/v2/assert" ) func TestUser(t *testing.T) { @@ -54,8 +54,7 @@ func TestUser(t *testing.T) { import ( "testing" - "github.com/stretchr/testify/assert" - + "github.com/go-openapi/testify/v2/assert" "github.com/go-openapi/testify/v2/require" ) @@ -210,8 +209,7 @@ Testify provides multiple ways to call assertions: import ( "testing" - "gotest.tools/assert" - + "github.com/go-openapi/testify/v2/assert" "github.com/go-openapi/testify/v2/require" ) @@ -291,7 +289,7 @@ import ( "slices" "testing" - "gotest.tools/assert" + "github.com/go-openapi/testify/v2/assert" ) func TestAdd(t *testing.T) { @@ -456,17 +454,16 @@ func TestPanics(t *testing.T) { import ( "testing" - "gotest.tools/assert" - + "github.com/go-openapi/testify/v2/assert" "github.com/go-openapi/testify/v2/require" ) func TestWithSetup(t *testing.T) { // Setup db := setupTestDatabase(t) - t.Cleanup(func() { - db.Close() // Teardown - }) + t.Cleanup(func() { + db.Close() // Teardown + }) // Test user := &User{Name: "Alice"} diff --git a/docs/doc-site/usage/GENERICS.md b/docs/doc-site/usage/GENERICS.md index a58515848..e59748af7 100644 --- a/docs/doc-site/usage/GENERICS.md +++ b/docs/doc-site/usage/GENERICS.md @@ -78,7 +78,7 @@ func TestUser(t *testing.T) { // actualOrder ✗ (wrong type - grayed out) ``` -4. **Performance-critical tests** - See [benchmarks](../../project/maintainers/BENCHMARKS.md) for 1.2-81x speedups +4. **Performance-critical tests** - See [benchmarks](../project/maintainers/BENCHMARKS.md) for 1.2-81x speedups ### 🔄 Use Reflection Variants (no suffix) When: @@ -236,7 +236,7 @@ Testify v2 provides generic variants across all major domains: - `YAMLEqT[S Text]` - YAML strings are semantically equal {{% notice style="info" title="See Complete API" icon="book" %}} -For a detailed documentation of all generic functions, see the [API Reference](../../api/_index.md) organized by domain. +For a detailed documentation of all generic functions, see the [API Reference](../api/_index.md) organized by domain. {{% /notice %}} ## Practical Examples @@ -527,7 +527,7 @@ Generic assertions provide significant performance improvements, especially for | **SliceContainsT** | **16x faster** | Collection membership tests | {{% notice style="success" title="Learn More" icon="chart-line" %}} -See the complete [Performance Benchmarks](../../project/maintainers/BENCHMARKS.md) for detailed analysis and real benchmark results. +See the complete [Performance Benchmarks](../project/maintainers/BENCHMARKS.md) for detailed analysis and real benchmark results. {{% /notice %}} ## Best Practices @@ -624,7 +624,7 @@ Generic assertions use custom type constraints defined in `internal/assertions/g - **Format variants**: Add `Tf` suffix (e.g., `EqualTf`, `GreaterTf`) - **When to use**: Prefer generics for known concrete types - **When not to**: Keep reflection for dynamic types and cross-type comparisons -- **Performance**: See [benchmarks](../../project/maintainers/BENCHMARKS.md) for dramatic speedups +- **Performance**: See [benchmarks](../project/maintainers/BENCHMARKS.md) for dramatic speedups {{% /notice %}} --- @@ -634,6 +634,6 @@ Generic assertions use custom type constraints defined in `internal/assertions/g - [Examples](./EXAMPLES.md) - Practical examples including generic assertion usage - [Tutorial](./TUTORIAL.md) - Best practices for writing tests with testify - [Usage Guide](./USAGE.md) - API conventions and naming patterns -- [Performance Benchmarks](../../project/maintainers/BENCHMARKS.md) - Detailed performance analysis of generic vs reflection +- [Performance Benchmarks](../project/maintainers/BENCHMARKS.md) - Detailed performance analysis of generic vs reflection - [Changes from v1](./CHANGES.md) - Complete list of new generic functions and improvements - [API Reference](../api/_index.md) - Complete assertion catalog with all generic variants diff --git a/docs/doc-site/usage/TRACKING.md b/docs/doc-site/usage/TRACKING.md index c244ae50f..ec5ecc9bf 100644 --- a/docs/doc-site/usage/TRACKING.md +++ b/docs/doc-site/usage/TRACKING.md @@ -45,7 +45,7 @@ We continue to monitor and selectively adopt changes from the upstream repositor [#1822]: https://github.com/stretchr/testify/issues/1822 [#1825]: https://github.com/stretchr/testify/pull/1825 [#1828]: https://github.com/stretchr/testify/pull/1828 -[1829]: https://github.com/stretchr/testify/issues/1829 +[#1829]: https://github.com/stretchr/testify/issues/1829 ## Appendix: Upstream References diff --git a/docs/doc-site/usage/TUTORIAL.md b/docs/doc-site/usage/TUTORIAL.md index 1b1fb339a..eb3209a6e 100644 --- a/docs/doc-site/usage/TUTORIAL.md +++ b/docs/doc-site/usage/TUTORIAL.md @@ -114,7 +114,7 @@ Instead of writing separate test functions for each case: import ( "testing" - "gotest.tools/assert" + "github.com/go-openapi/testify/v2/assert" ) // ❌ Don't do this - repetitive and hard to maintain @@ -255,7 +255,7 @@ func TestAdd(t *testing.T) { import ( "testing" - "gotest.tools/assert" + "github.com/go-openapi/testify/v2/assert" ) func TestAdd(t *testing.T) { @@ -470,7 +470,7 @@ Always use `t.Parallel()` unless you have a specific reason not to: import ( "testing" - "gotest.tools/assert" + "github.com/go-openapi/testify/v2/assert" ) func TestAdd(t *testing.T) { diff --git a/docs/doc-site/usage/USAGE.md b/docs/doc-site/usage/USAGE.md index 16a8e79b9..9e39c948f 100644 --- a/docs/doc-site/usage/USAGE.md +++ b/docs/doc-site/usage/USAGE.md @@ -30,24 +30,24 @@ Assertions are grouped by domain for easier discovery: | **Others** | HTTP, JSON, YAML, Time, File assertions | 12 | {{% notice style="info" title="Browse by Domain" icon="book" %}} -See the complete [API Reference](../../api/_index.md) organized by domain for a detailed documentation of all assertions. +See the complete [API Reference](../api/_index.md) organized by domain for a detailed documentation of all assertions. {{% /notice %}} ## Navigating the Documentation ### Quick Reference -- **[Examples](../examples)** - Practical code examples for common testing scenarios -- **[API Reference](../../api/_index.md)** - Complete assertion catalog organized by domain +- **[Examples](./EXAMPLES.md)** - Practical code examples for common testing scenarios +- **[API Reference](../api/_index.md)** - Complete assertion catalog organized by domain - **[Generics Guide](../GENERICS.md)** - Using type-safe assertions with the `T` suffix - **[Changes](../CHANGES.md)** - All changes since fork from stretchr/testify - **[pkg.go.dev](https://pkg.go.dev/github.com/go-openapi/testify/v2)** - godoc API reference with full signatures ### Finding the Right Assertion -1. Browse the [API Reference](../../api/_index.md) by domain (e.g., "Collection" for slice operations) -2. Search in the [API Reference](../../api/_index.md) (use search box) -3. Check (or search) the provided [Examples](../examples) for practical usage patterns +1. Browse the [API Reference](../api/_index.md) by domain (e.g., "Collection" for slice operations) +2. Search in the [API Reference](../api/_index.md) (use search box) +3. Check (or search) the provided [Examples](./EXAMPLES.md) for practical usage patterns 4. Check [pkg.go.dev](https://pkg.go.dev/github.com/go-openapi/testify/v2/assert) for alphabetical listing 5. Use your editor's Go to Definition on any assertion 6. Use your IDE's autocomplete - type `assert.` and explore @@ -262,7 +262,7 @@ assert.Eventually(t, condition, waitFor, tick) // Condition first, timing p {{% notice style="tip" title="Finding Argument Order" icon="lightbulb" %}} When unsure about argument order: -- Check the [API Reference](../../api/_index.md) for detailed signatures +- Check the [API Reference](../api/_index.md) for detailed signatures - Use IDE autocomplete to see parameter names - Consult [pkg.go.dev](https://pkg.go.dev/github.com/go-openapi/testify/v2/assert) for complete documentation {{% /notice %}} @@ -328,7 +328,7 @@ import ( "slices" "testing" - "gotest.tools/assert" + "github.com/go-openapi/testify/v2/assert" ) func TestCalculation(t *testing.T) { @@ -428,7 +428,9 @@ func TestTypeSafety(t *testing.T) { 1. **Import the package:** ```go + import "github.com/go-openapi/testify/v2/assert" // or + import "github.com/go-openapi/testify/v2/require" ``` 2. **Choose your style:** @@ -436,11 +438,11 @@ func TestTypeSafety(t *testing.T) { - Forward methods: `a := assert.New(t); a.Equal(expected, actual)` 3. **Explore by domain:** - - Browse [API Reference](../../api/_index.md) to discover assertions - - Check [Examples](../examples) for practical patterns + - Browse [API Reference](../api/_index.md) to discover assertions + - Check [Examples](./EXAMPLES.md) for practical patterns 4. **Use generics for type safety:** - - See [Generics Guide](../GENERICS.md) for type-safe assertions + - See [Generics Guide](./GENERICS.md) for type-safe assertions - Add `T` suffix for compile-time type checking ## Best Practices @@ -462,9 +464,9 @@ func TestTypeSafety(t *testing.T) { {{% notice style="success" title="Ready to Test" icon="check" %}} **Next Steps:** -- Explore [Examples](../examples) for practical usage patterns -- Browse the [API Reference](../../api/_index.md) to discover assertions -- Read the [Generics Guide](../GENERICS.md) for type-safe testing +- Explore [Examples](./EXAMPLES.md) for practical usage patterns +- Browse the [API Reference](../api/_index.md) to discover assertions +- Read the [Generics Guide](./GENERICS.md) for type-safe testing - Check [pkg.go.dev](https://pkg.go.dev/github.com/go-openapi/testify/v2) for complete reference {{% /notice %}} @@ -540,7 +542,7 @@ age: 30 Different YAML libraries offer different trade-offs: **`gopkg.in/yaml.v3` (default):** -- De factor standard library for Go YAML +- De facto standard library for Go YAML - Widely used and well-tested - Complete YAML 1.2 support