From 4aebe355599c75ae344ab6a7fa27bd53de34baae Mon Sep 17 00:00:00 2001 From: Adam Luzsi Date: Wed, 1 May 2024 22:14:23 +0200 Subject: [PATCH] tests --- Spec_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Spec_test.go b/Spec_test.go index bbd75a8..156eb49 100644 --- a/Spec_test.go +++ b/Spec_test.go @@ -1583,6 +1583,20 @@ func BenchmarkTestSpec_Benchmark(b *testing.B) { assert.True(b, benchRan2) b.Skip("done") }) + b.Run("skip", func(b *testing.B) { + var benchRan1 bool + s := testcase.NewSpec(b) + s.SkipBenchmark() + s.Context("1", func(s *testcase.Spec) { + s.Benchmark("A", func(t *testcase.T) { + benchRan1 = true + t.Skip() + }) + }) + s.Finish() + assert.False(b, benchRan1) + b.Skip("done") + }) b.Run("hook", func(b *testing.B) { var hookRan, benchRan bool s := testcase.NewSpec(b)