diff options
author | EuAndreh <eu@euandre.org> | 2025-05-07 07:02:57 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-05-07 07:16:33 -0300 |
commit | d3cb41376ac0be31ed2b6649dd8d6b42674ebeaf (patch) | |
tree | df7eeb84a91114b6624a0f0fe7c1b11fa7e5ae1f /tests/fuzz/new-v7-from/uuid.go | |
parent | tests/{cli-opts,integration}.sh: Add test implementations (diff) | |
download | uuid-d3cb41376ac0be31ed2b6649dd8d6b42674ebeaf.tar.gz uuid-d3cb41376ac0be31ed2b6649dd8d6b42674ebeaf.tar.xz |
Support UUIDv7, with -vN for choosing
Diffstat (limited to 'tests/fuzz/new-v7-from/uuid.go')
-rw-r--r-- | tests/fuzz/new-v7-from/uuid.go | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/fuzz/new-v7-from/uuid.go b/tests/fuzz/new-v7-from/uuid.go new file mode 100644 index 0000000..8686ebf --- /dev/null +++ b/tests/fuzz/new-v7-from/uuid.go @@ -0,0 +1,33 @@ +package uuid + +import ( + "bytes" + "os" + "testing" + "testing/internal/testdeps" +) + + + +func fn(f *testing.F) { + f.Fuzz(func(t *testing.T, payload []byte, nanosecs uint64) { + NewV7From(bytes.NewReader(payload), func() uint64 { + return nanosecs + }) + }) +} + + + +func MainTest() { + fuzzTargets := []testing.InternalFuzzTarget{ + { "fn", fn }, + } + + deps := testdeps.TestDeps{} + tests := []testing.InternalTest {} + benchmarks := []testing.InternalBenchmark{} + examples := []testing.InternalExample {} + m := testing.MainStart(deps, tests, benchmarks, fuzzTargets, examples) + os.Exit(m.Run()) +} |