Documentation ¶
Overview ¶
Package test provides generic tests of the leakybucket interface.
Index ¶
- func AddResetTest(s leakybucket.Storage) func(*testing.T)
- func AddTest(s leakybucket.Storage) func(*testing.T)
- func BucketInstanceConsistencyTest(s leakybucket.Storage) func(*testing.T)
- func CreateTest(s leakybucket.Storage) func(*testing.T)
- func FindOrCreateTest(s leakybucket.Storage) func(*testing.T)
- func ThreadSafeAddTest(s leakybucket.Storage) func(*testing.T)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddResetTest ¶
func AddResetTest(s leakybucket.Storage) func(*testing.T)
AddResetTest returns a test that Add performs properly across reset time boundaries. It is meant to be used by leakybucket implementers who wish to test this.
func AddTest ¶
func AddTest(s leakybucket.Storage) func(*testing.T)
AddTest returns a test that adding to a single bucket works. It is meant to be used by leakybucket implementers who wish to test this.
func BucketInstanceConsistencyTest ¶
func BucketInstanceConsistencyTest(s leakybucket.Storage) func(*testing.T)
BucketInstanceConsistencyTest returns a test that two instances of a leakybucket pointing to the same remote bucket keep consistent state with the remote.
func CreateTest ¶
func CreateTest(s leakybucket.Storage) func(*testing.T)
CreateTest returns a test of bucket creation for a given storage backend. It is meant to be used by leakybucket implementers who wish to test this.
func FindOrCreateTest ¶
func FindOrCreateTest(s leakybucket.Storage) func(*testing.T)
FindOrCreateTest returns a test that the Create function is essentially a FindOrCreate: if you create one bucket, wait some time, and create another bucket with the same name, all the properties should be the same. It is meant to be used by leakybucket implementers who wish to test this.
func ThreadSafeAddTest ¶
func ThreadSafeAddTest(s leakybucket.Storage) func(*testing.T)
ThreadSafeAddTest returns a test that adding to a single bucket is thread-safe. It is meant to be used by leakybucket implementers who wish to test this.
Types ¶
This section is empty.