diff --git a/runner/run_test.go b/runner/run_test.go index 02bbbf6..8db508b 100644 --- a/runner/run_test.go +++ b/runner/run_test.go @@ -277,6 +277,8 @@ func (s *runTestSuite) TestRunTests_Run() { ShowTime: true, }, s.out) s.Require().NoError(err) + s.Len(res.Stats.Success, 5, "verbose and execute all failed") + s.Len(res.Stats.Skipped, 0, "verbose and execute all failed") s.Equal(res.Stats.TotalFailed(), 0, "verbose and execute all failed") }) @@ -285,23 +287,29 @@ func (s *runTestSuite) TestRunTests_Run() { Include: regexp.MustCompile("0*"), }, s.out) s.Require().NoError(err) + s.Len(res.Stats.Success, 5, "do not show time and execute all failed") + s.Len(res.Stats.Skipped, 0, "do not show time and execute all failed") s.Equal(res.Stats.TotalFailed(), 0, "do not show time and execute all failed") }) - s.Run("execute only test 008 but exclude all", func() { + s.Run("execute only test 8 but exclude all", func() { res, err := Run(s.cfg, s.ftwTests, RunnerConfig{ - Include: regexp.MustCompile("008"), + Include: regexp.MustCompile("-8$"), // test ID is matched in format `-` Exclude: regexp.MustCompile("0*"), }, s.out) s.Require().NoError(err) - s.Equal(res.Stats.TotalFailed(), 0, "do not show time and execute all failed") + s.Len(res.Stats.Success, 1, "execute only test 008 but exclude all") + s.Len(res.Stats.Skipped, 4, "execute only test 008 but exclude all") + s.Equal(res.Stats.TotalFailed(), 0, "execute only test 008 but exclude all") }) - s.Run("exclude test 010", func() { + s.Run("exclude test 10", func() { res, err := Run(s.cfg, s.ftwTests, RunnerConfig{ - Exclude: regexp.MustCompile("010"), + Exclude: regexp.MustCompile("-10$"), // test ID is matched in format `-` }, s.out) s.Require().NoError(err) + s.Len(res.Stats.Success, 4, "failed to exclude test") + s.Len(res.Stats.Skipped, 1, "failed to exclude test") s.Equal(res.Stats.TotalFailed(), 0, "failed to exclude test") }) @@ -325,11 +333,13 @@ func (s *runTestSuite) TestRunTests_Run() { s.Run("test exceptions 1", func() { res, err := Run(s.cfg, s.ftwTests, RunnerConfig{ - Include: regexp.MustCompile("1*"), - Exclude: regexp.MustCompile("0*"), + Include: regexp.MustCompile("-1.*"), + Exclude: regexp.MustCompile("-0.*"), Output: output.Quiet, }, s.out) s.Require().NoError(err) + s.Len(res.Stats.Success, 4, "failed to test exceptions") + s.Len(res.Stats.Skipped, 1, "failed to test exceptions") s.Equal(res.Stats.TotalFailed(), 0, "failed to test exceptions") }) }