Skip to content

Commit

Permalink
upgrade tests (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
chen3feng authored Aug 15, 2022
1 parent bac7042 commit b28d649
Show file tree
Hide file tree
Showing 10 changed files with 1,618 additions and 78 deletions.
12 changes: 6 additions & 6 deletions dlist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ func Test_Dlist_Interface(t *testing.T) {
func Test_DList_New(t *testing.T) {
l := NewDList[int]()
expectTrue(t, l.IsEmpty())
expectEq(t, 0, l.Len())
expectEq(t, l.Len(), 0)
}

func Test_DList_NewOf(t *testing.T) {
l := NewDListOf(1, 2, 3)
expectFalse(t, l.IsEmpty())
expectEq(t, 3, l.Len())
expectEq(t, l.Len(), 3)
}

func Test_DList_String(t *testing.T) {
l := NewDList[int]()
expectEq(t, "DList[int]", l.String())
expectEq(t, l.String(), "DList[int]")
}

func Test_DList_Iterate(t *testing.T) {
Expand All @@ -39,14 +39,14 @@ func Test_DList_PushFront(t *testing.T) {
l := NewDList[int]()
l.PushFront(1)
expectFalse(t, l.IsEmpty())
expectEq(t, 1, l.Len())
expectEq(t, l.Len(), 1)
}

func Test_DList_PushBack(t *testing.T) {
l := NewDList[int]()
l.PushBack(1)
expectFalse(t, l.IsEmpty())
expectEq(t, 1, l.Len())
expectEq(t, l.Len(), 1)
}

func Test_DList_PopFront(t *testing.T) {
Expand All @@ -66,7 +66,7 @@ func Test_DList_PushBack_PopFront(t *testing.T) {
l.PushBack(1)
v, ok := l.PopFront()
expectTrue(t, ok)
expectEq(t, 1, v)
expectEq(t, v, 1)
}

func Test_DList_PushBack_PopBack(t *testing.T) {
Expand Down
Loading

0 comments on commit b28d649

Please sign in to comment.