algo/go/09_queue/QueueBasedOnLinkedList_test.go

36 lines
484 B
Go
Raw Normal View History

2018-10-11 22:33:32 +08:00
package _9_queue
import "testing"
func TestListQueue_EnQueue(t *testing.T) {
q := NewLinkedListQueue()
q.EnQueue(1)
q.EnQueue(2)
q.EnQueue(3)
q.EnQueue(4)
q.EnQueue(5)
q.EnQueue(6)
t.Log(q)
}
func TestListQueue_DeQueue(t *testing.T) {
q := NewLinkedListQueue()
q.EnQueue(1)
q.EnQueue(2)
q.EnQueue(3)
q.EnQueue(4)
q.EnQueue(5)
q.EnQueue(6)
t.Log(q)
q.DeQueue()
t.Log(q)
q.DeQueue()
t.Log(q)
q.DeQueue()
t.Log(q)
q.DeQueue()
t.Log(q)
q.DeQueue()
t.Log(q)
}