You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
277 B

6 months ago
  1. package util
  2. import (
  3. "github.com/stretchr/testify/assert"
  4. "testing"
  5. )
  6. func TestNewQueue(t *testing.T) {
  7. q := NewQueue[int]()
  8. for i := 0; i < 10; i++ {
  9. q.Enqueue(i)
  10. }
  11. assert.Equal(t, q.Len(), 10)
  12. for i := 0; i < 10; i++ {
  13. assert.Equal(t, q.Dequeue(), i)
  14. }
  15. }