mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-24 02:31:18 -08:00
Prior to this change there were two problems with our fuzzing for oss-fuzz: 1. There was an issue if the fuzzing spanned two files (mingled with the testing). 2. The fuzzing needs to be part of the implementation package (no _test packages). This change fixes that by moving all package fuzzing into a common `fuzz_test.go` within the package. Updates https://github.com/tailscale/corp/issues/46608 Change-Id: I0b95edcd0df946f723eea32f575c679214c0b202 Signed-off-by: Mike Jensen <[email protected]>
23 lines
433 B
Go
23 lines
433 B
Go
// Copyright (c) Tailscale Inc & contributors
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
package nocasemaps
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func FuzzAppendToLower(f *testing.F) {
|
|
for _, tt := range lowerTests {
|
|
f.Add(tt.in)
|
|
}
|
|
f.Fuzz(func(t *testing.T, in string) {
|
|
got := string(appendToLower(nil, in))
|
|
want := strings.ToLower(in)
|
|
if got != want {
|
|
t.Errorf("appendToLower(%q) = %q, want %q", in, got, want)
|
|
}
|
|
})
|
|
}
|