z_test.go 261 B

12345678910111213141516171819
  1. package containers
  2. import "testing"
  3. func TestQueue(t *testing.T) {
  4. var q Queue
  5. q.Push("one", "two", "three")
  6. q.Push("four")
  7. q.Push("five")
  8. t.Log(q)
  9. for {
  10. if val, check := q.Pop(); check {
  11. t.Log(val, q.Size())
  12. } else {
  13. break
  14. }
  15. }
  16. t.Log(q)
  17. }