Skip to content

Commit

Permalink
Add test for 'UnitWithCacheClient' option.
Browse files Browse the repository at this point in the history
  • Loading branch information
fr33r committed Oct 14, 2023
1 parent 30bd56a commit 856fa64
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions v4/unit_options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,17 @@ func (s *UnitOptionsTestSuite) TestUnitRetryType() {
s.Equal(t, s.sut.retryType)
}

func (s *UnitOptionsTestSuite) TestUnitWithCacheClient() {
// arrange.
cacheClient := &memoryCacheClient{}

// action.
UnitWithCacheClient(cacheClient)(s.sut)

// assert.
s.Equal(cacheClient, s.sut.cacheClient)
}

func (s *UnitOptionsTestSuite) TearDownTest() {
s.sut = nil
}
Expand Down

1 comment on commit 856fa64

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 856fa64 Previous: 3a66725 Ratio
BenchmarkRegister 491438 ns/op 415807 ns/op 1.18
BenchmarkAdd 107056 ns/op 127644 ns/op 0.84
BenchmarkAlter 300814 ns/op 214197 ns/op 1.40
BenchmarkRemove 298933 ns/op 210620 ns/op 1.42
BenchmarkSave/BestEffort 8743 ns/op 9093 ns/op 0.96

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.