diff options
author | borman <borman@yandex-team.com> | 2023-12-06 18:01:50 +0300 |
---|---|---|
committer | borman <borman@yandex-team.com> | 2023-12-06 20:11:17 +0300 |
commit | 129dd7a20d55f0c0cb9de5581603e8e0b9db0da4 (patch) | |
tree | 6d90179a43d746e6159d76d5ec18c8b74d60de3b /vendor/github.com/google/uuid/uuid_test.go | |
parent | 8888ab678beb41b8a848e59a491017a8d08fe53f (diff) | |
download | ydb-129dd7a20d55f0c0cb9de5581603e8e0b9db0da4.tar.gz |
Update dns, uuid, websocket for import
* Disable unix domain socket tests in dns (fail under ya make)
Diffstat (limited to 'vendor/github.com/google/uuid/uuid_test.go')
-rw-r--r-- | vendor/github.com/google/uuid/uuid_test.go | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/vendor/github.com/google/uuid/uuid_test.go b/vendor/github.com/google/uuid/uuid_test.go index e98d0fe03c..6f22e8a611 100644 --- a/vendor/github.com/google/uuid/uuid_test.go +++ b/vendor/github.com/google/uuid/uuid_test.go @@ -569,6 +569,39 @@ func TestIsWrongLength(t *testing.T) { } } +func FuzzParse(f *testing.F) { + for _, tt := range tests { + f.Add(tt.in) + f.Add(strings.ToUpper(tt.in)) + } + f.Fuzz(func(t *testing.T, in string) { + Parse(in) + }) +} + +func FuzzParseBytes(f *testing.F) { + for _, tt := range tests { + f.Add([]byte(tt.in)) + } + f.Fuzz(func(t *testing.T, in []byte) { + ParseBytes(in) + }) +} + +func FuzzFromBytes(f *testing.F) { + // Copied from TestFromBytes. + f.Add([]byte{ + 0x7d, 0x44, 0x48, 0x40, + 0x9d, 0xc0, + 0x11, 0xd1, + 0xb2, 0x45, + 0x5f, 0xfd, 0xce, 0x74, 0xfa, 0xd2, + }) + f.Fuzz(func(t *testing.T, in []byte) { + FromBytes(in) + }) +} + var asString = "f47ac10b-58cc-0372-8567-0e02b2c3d479" var asBytes = []byte(asString) @@ -700,3 +733,18 @@ func BenchmarkUUID_NewPooled(b *testing.B) { } }) } + +func BenchmarkUUIDs_Strings(b *testing.B) { + uuid1, err := Parse("f47ac10b-58cc-0372-8567-0e02b2c3d479") + if err != nil { + b.Fatal(err) + } + uuid2, err := Parse("7d444840-9dc0-11d1-b245-5ffdce74fad2") + if err != nil { + b.Fatal(err) + } + uuids := UUIDs{uuid1, uuid2} + for i := 0; i < b.N; i++ { + uuids.Strings() + } +} |