mirror of
https://github.com/emirpasic/gods.git
synced 2026-06-17 16:36:39 +03:00
Improve code coverage
This commit is contained in:
@@ -116,6 +116,12 @@ func TestStackIteratorNext(t *testing.T) {
|
||||
if actualValue, expectedValue := count, 3; actualValue != expectedValue {
|
||||
t.Errorf("Got %v expected %v", actualValue, expectedValue)
|
||||
}
|
||||
|
||||
stack.Clear()
|
||||
it = stack.Iterator()
|
||||
for it.Next() {
|
||||
t.Errorf("Shouldn't iterate on empty stack")
|
||||
}
|
||||
}
|
||||
|
||||
func TestStackIteratorPrev(t *testing.T) {
|
||||
@@ -371,6 +377,19 @@ func TestStackSerialization(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("Got error %v", err)
|
||||
}
|
||||
|
||||
err = json.Unmarshal([]byte(`[1,2,3]`), &stack)
|
||||
if err != nil {
|
||||
t.Errorf("Got error %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestStackString(t *testing.T) {
|
||||
c := New()
|
||||
c.Push(1)
|
||||
if !strings.HasPrefix(c.String(), "ArrayStack") {
|
||||
t.Errorf("String should start with container name")
|
||||
}
|
||||
}
|
||||
|
||||
func benchmarkPush(b *testing.B, stack *Stack, size int) {
|
||||
|
||||
Reference in New Issue
Block a user