From 4fc3a91d35eb3205c9aa7a7621eb4ccedaf087af Mon Sep 17 00:00:00 2001 From: huangsimin Date: Thu, 6 Dec 2018 15:54:20 +0800 Subject: [PATCH] PriorityQueue test move to struture_test.go --- base_test.go | 25 ------------------------- structure_test.go | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/base_test.go b/base_test.go index 320dbc0..810a7cd 100644 --- a/base_test.go +++ b/base_test.go @@ -1,26 +1 @@ package curl2info - -import ( - "strconv" - "testing" -) - -func TestPQueue(t *testing.T) { - PQExec := newPQueueExecute() - PQExec.Push(&parseFunction{Priority: 5}) - PQExec.Push(&parseFunction{Priority: 10}) - PQExec.Push(&parseFunction{Priority: 4}) - PQExec.Push(&parseFunction{Priority: 4}) - PQExec.Push(&parseFunction{Priority: 20}) - PQExec.Push(&parseFunction{Priority: 10}) - PQExec.Push(&parseFunction{Priority: 15}) - - content := "" - for PQExec.Len() > 0 { - content += strconv.Itoa(PQExec.Pop().Priority) - content += " " - } - if content != "4 4 5 10 10 15 20 " { - t.Error(content) - } -} diff --git a/structure_test.go b/structure_test.go index 810a7cd..320dbc0 100644 --- a/structure_test.go +++ b/structure_test.go @@ -1 +1,26 @@ package curl2info + +import ( + "strconv" + "testing" +) + +func TestPQueue(t *testing.T) { + PQExec := newPQueueExecute() + PQExec.Push(&parseFunction{Priority: 5}) + PQExec.Push(&parseFunction{Priority: 10}) + PQExec.Push(&parseFunction{Priority: 4}) + PQExec.Push(&parseFunction{Priority: 4}) + PQExec.Push(&parseFunction{Priority: 20}) + PQExec.Push(&parseFunction{Priority: 10}) + PQExec.Push(&parseFunction{Priority: 15}) + + content := "" + for PQExec.Len() > 0 { + content += strconv.Itoa(PQExec.Pop().Priority) + content += " " + } + if content != "4 4 5 10 10 15 20 " { + t.Error(content) + } +}