@@ -14,7 +14,6 @@ import (
14
14
"github.com/timtadh/data-structures/types"
15
15
)
16
16
17
-
18
17
func init () {
19
18
if urandom , err := os .Open ("/dev/urandom" ); err != nil {
20
19
panic (err )
@@ -27,7 +26,6 @@ func init() {
27
26
}
28
27
}
29
28
30
-
31
29
type T testing.T
32
30
33
31
func (t * T ) assert (msg string , oks ... bool ) {
@@ -69,7 +67,7 @@ func TestAppendGet(x *testing.T) {
69
67
list := New (10 )
70
68
items := make ([]types.ByteSlice , 0 , SIZE )
71
69
for i := 0 ; i < SIZE ; i ++ {
72
- item := t .randslice (rand .Intn (10 )+ 1 )
70
+ item := t .randslice (rand .Intn (10 ) + 1 )
73
71
items = append (items , item )
74
72
t .assert_nil (list .Append (item ))
75
73
}
@@ -86,7 +84,7 @@ func TestAppendGetCopy(x *testing.T) {
86
84
list := New (10 )
87
85
items := make ([]types.ByteSlice , 0 , SIZE )
88
86
for i := 0 ; i < SIZE ; i ++ {
89
- item := t .randslice (rand .Intn (10 )+ 1 )
87
+ item := t .randslice (rand .Intn (10 ) + 1 )
90
88
items = append (items , item )
91
89
t .assert_nil (list .Append (item ))
92
90
}
@@ -109,7 +107,7 @@ func TestAppendMarshalUnmarshalGet(x *testing.T) {
109
107
list := New (10 )
110
108
items := make ([]types.Int , 0 , SIZE )
111
109
for i := 0 ; i < SIZE ; i ++ {
112
- item := types .Int (rand .Intn (10 )+ 1 )
110
+ item := types .Int (rand .Intn (10 ) + 1 )
113
111
items = append (items , item )
114
112
t .assert_nil (list .Append (item ))
115
113
}
@@ -206,7 +204,7 @@ func TestAppendPop(x *testing.T) {
206
204
list := New (10 )
207
205
items := make ([]types.ByteSlice , 0 , SIZE )
208
206
for i := 0 ; i < SIZE ; i ++ {
209
- item := t .randslice (rand .Intn (10 )+ 1 )
207
+ item := t .randslice (rand .Intn (10 ) + 1 )
210
208
items = append (items , item )
211
209
t .assert_nil (list .Append (item ))
212
210
}
@@ -224,7 +222,7 @@ func TestExtend(x *testing.T) {
224
222
b := New (10 )
225
223
items := make ([]types.ByteSlice , 0 , SIZE )
226
224
for i := 0 ; i < SIZE ; i ++ {
227
- item := t .randslice (rand .Intn (10 )+ 1 )
225
+ item := t .randslice (rand .Intn (10 ) + 1 )
228
226
items = append (items , item )
229
227
if i < SIZE / 2 {
230
228
t .assert_nil (a .Append (item ))
@@ -278,4 +276,3 @@ func TestEqualsHash(x *testing.T) {
278
276
t .assert ("d.Hash() != b.Hash()" , d .Hash () != b .Hash ())
279
277
t .assert ("d.Hash() != empty.Hash()" , d .Hash () != empty .Hash ())
280
278
}
281
-
0 commit comments