CodeSampleX

Sample

Control testify suite execution and lifecycle hooks through the testify.m regex flag

sha256:4c3a1fafee223038dc33b51481aedf5c31bbd508ee95f5a14e4e0711d58f2484

Publication state. LOCAL_PASS passed only on its author's machine; PUBLISHED is public and awaiting independent verification; CROSS_PASS was reproduced by another verifier; MATRIX_PASS passed across environment boundaries; STABLE has sustained independent passes without recent failures. Evidence strength. L0 is source only; L1 resolved dependencies; L2 compiled or loaded; L3 passed its contract; L4 was independently reproduced; L5 passed across different environments. MIT-0

Execution evidence

Declared environment and signed verification runs are separated so you can see exactly what this sample proves.

Evidence basis
Independent cross-verification
Verification receipts
2
Verification level
L4_CROSS_PASS
Declared environment go linux x64 go go gomod

Verification-run environments

Environment Contract Stages Run
go 1.26 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · golang@1
2026-08-19
go 1.26 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · golang@1
2026-08-19

Case

HOW
Goal
Control testify suite execution and lifecycle hooks through the testify.m regex flag
Packages
Symbols
  • suite.Run
  • suite.Suite
Environment
go
Created
2026-08-19T13:31:30Z

Contract

  1. Setting the testify.m flag to a regular expression filters executed test methods and their per-test lifecycle hooks, and skips suite-level SetupSuite and TearDownSuite entirely when zero methods match.
  2. assert the suite package registers the testify.m string flag in flag.CommandLine with an empty string default
  3. assert default execution runs all Test methods and invokes SetupSuite, SetupTest, BeforeTest, AfterTest, TearDownTest, and TearDownSuite in exact lifecycle order
  4. assert setting testify.m to a matching regex executes only the matched method and skips lifecycle hooks for unmatched methods
  5. assert setting testify.m to a pattern matching no methods skips all test execution including SetupSuite and TearDownSuite
  6. assert methods without the Test prefix are never executed by suite.Run regardless of the testify.m filter pattern

Files

  • NOTES.md
  • csx.json
  • go.mod
  • go.sum
  • suite_config_test.go
  • tracker.go

Download the source artifact (tar.gz)

Origin Seeder

csx-seed