github.com/Greyh4t/queue@v0.0.0-20181115064813-9f22fdae8f93/queue_test.go (about) 1 package queue 2 3 import "testing" 4 5 var ( 6 q = New() 7 ts = "test string" 8 ti = 0 9 ) 10 11 func BenchmarkPushBack(t *testing.B) { 12 q.PushBack(ts) 13 } 14 15 func BenchmarkPushFront(t *testing.B) { 16 q.PushFront(ts) 17 } 18 19 func BenchmarkFront(t *testing.B) { 20 q.Front() 21 } 22 23 func BenchmarkBack(t *testing.B) { 24 q.Back() 25 } 26 27 func BenchmarkMultPushFront(t *testing.B) { 28 q.PushFront(ti, ts, ti, ts, ti, ts, ti, ts, ti, ts) 29 } 30 31 func BenchmarkMultPushBack(t *testing.B) { 32 q.PushBack(ti, ts, ti, ts, ti, ts, ti, ts, ti, ts) 33 }