-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09b29c4
commit 7238662
Showing
4 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package operand | ||
|
||
import "testing" | ||
|
||
type dummy struct{} | ||
|
||
func (dummy) Run(string, func(t *testing.T)) {} | ||
|
||
func Test_Run(t *testing.T) { | ||
t.Run("find me", func(t *testing.T) { | ||
}) | ||
|
||
x := dummy{} | ||
x.Run("don't find me", func(t *testing.T) { | ||
}) | ||
|
||
router := dummy{} | ||
router.Run("don't find me", func(t *testing.T) { | ||
}) | ||
} | ||
|
||
func Benchmark_Run(b *testing.B) { | ||
// NOTE: support for benchmarks could potentially be added. | ||
b.Run("benchmark case", func(b *testing.B) { | ||
for i := 0; i < b.N; i++ { | ||
// Add benchmark logic here | ||
dummy{}.Run("test", func(t *testing.T) {}) | ||
} | ||
}) | ||
} | ||
|
||
func FuzzRun(f *testing.F) { | ||
// NOTE: support for fuzz tests could potentially be added. | ||
|
||
// Add seed corpus | ||
f.Add("test input") | ||
|
||
// Actual fuzz test | ||
f.Fuzz(func(t2 *testing.T, input string) { | ||
t := dummy{} | ||
t.Run(input, func(t *testing.T) { | ||
// Add fuzzing logic here | ||
}) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters