From d3cb41376ac0be31ed2b6649dd8d6b42674ebeaf Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 7 May 2025 07:02:57 -0300 Subject: Support UUIDv7, with -vN for choosing --- tests/fuzz/new-from/main.go | 1 - tests/fuzz/new-from/uuid.go | 31 ------------------------------- tests/fuzz/new-v4-from/main.go | 1 + tests/fuzz/new-v4-from/uuid.go | 31 +++++++++++++++++++++++++++++++ tests/fuzz/new-v7-from/main.go | 1 + tests/fuzz/new-v7-from/uuid.go | 33 +++++++++++++++++++++++++++++++++ 6 files changed, 66 insertions(+), 32 deletions(-) delete mode 120000 tests/fuzz/new-from/main.go delete mode 100644 tests/fuzz/new-from/uuid.go create mode 120000 tests/fuzz/new-v4-from/main.go create mode 100644 tests/fuzz/new-v4-from/uuid.go create mode 120000 tests/fuzz/new-v7-from/main.go create mode 100644 tests/fuzz/new-v7-from/uuid.go (limited to 'tests/fuzz') diff --git a/tests/fuzz/new-from/main.go b/tests/fuzz/new-from/main.go deleted file mode 120000 index f67563d..0000000 --- a/tests/fuzz/new-from/main.go +++ /dev/null @@ -1 +0,0 @@ -../../main.go \ No newline at end of file diff --git a/tests/fuzz/new-from/uuid.go b/tests/fuzz/new-from/uuid.go deleted file mode 100644 index 298687b..0000000 --- a/tests/fuzz/new-from/uuid.go +++ /dev/null @@ -1,31 +0,0 @@ -package uuid - -import ( - "bytes" - "os" - "testing" - "testing/internal/testdeps" -) - - - -func fn(f *testing.F) { - f.Fuzz(func(t *testing.T, payload []byte) { - NewFrom(bytes.NewReader(payload)) - }) -} - - - -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()) -} diff --git a/tests/fuzz/new-v4-from/main.go b/tests/fuzz/new-v4-from/main.go new file mode 120000 index 0000000..f67563d --- /dev/null +++ b/tests/fuzz/new-v4-from/main.go @@ -0,0 +1 @@ +../../main.go \ No newline at end of file diff --git a/tests/fuzz/new-v4-from/uuid.go b/tests/fuzz/new-v4-from/uuid.go new file mode 100644 index 0000000..90cc994 --- /dev/null +++ b/tests/fuzz/new-v4-from/uuid.go @@ -0,0 +1,31 @@ +package uuid + +import ( + "bytes" + "os" + "testing" + "testing/internal/testdeps" +) + + + +func fn(f *testing.F) { + f.Fuzz(func(t *testing.T, payload []byte) { + NewV4From(bytes.NewReader(payload)) + }) +} + + + +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()) +} diff --git a/tests/fuzz/new-v7-from/main.go b/tests/fuzz/new-v7-from/main.go new file mode 120000 index 0000000..f67563d --- /dev/null +++ b/tests/fuzz/new-v7-from/main.go @@ -0,0 +1 @@ +../../main.go \ No newline at end of file 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()) +} -- cgit v1.2.3