github.com/loov/combiner@v0.1.0/all_test.go (about)

     1  package combiner
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/loov/combiner/testsuite"
     7  )
     8  
     9  // All contains all combiner queue descriptions
    10  var All = testsuite.Descs{
    11  	{
    12  		Name:    "Spinning",
    13  		Bounded: true,
    14  		Create: func(bat testsuite.Batcher, bound int) testsuite.Combiner {
    15  			return NewSpinning(bat, bound)
    16  		},
    17  	}, {
    18  		Name:    "Parking",
    19  		Bounded: true,
    20  		Create: func(bat testsuite.Batcher, bound int) testsuite.Combiner {
    21  			return NewParking(bat, bound)
    22  		},
    23  	},
    24  }
    25  
    26  func Test(t *testing.T) {
    27  	testsuite.Test.Iterate(All, func(setup *testsuite.Setup) {
    28  		testsuite.RunTests(t, setup)
    29  	})
    30  }
    31  
    32  func Benchmark(b *testing.B) {
    33  	testsuite.Bench.Iterate(All, func(setup *testsuite.Setup) {
    34  		testsuite.RunBenchmarks(b, setup)
    35  	})
    36  }