@@ -11,7 +11,7 @@ import (
11
11
"bytes"
12
12
"testing"
13
13
14
- "github.com/stretchr/testify/assert "
14
+ "github.com/stretchr/testify/require "
15
15
)
16
16
17
17
func TestChunkBasicHeader (t * testing.T ) {
@@ -116,8 +116,8 @@ func TestChunkBasicHeader(t *testing.T) {
116
116
117
117
buf := new (bytes.Buffer )
118
118
err := encodeChunkBasicHeader (buf , tc .value )
119
- assert .Nil (t , err )
120
- assert .Equal (t , tc .binary , buf .Bytes ())
119
+ require .Nil (t , err )
120
+ require .Equal (t , tc .binary , buf .Bytes ())
121
121
})
122
122
}
123
123
})
@@ -132,8 +132,8 @@ func TestChunkBasicHeader(t *testing.T) {
132
132
r := bytes .NewReader (tc .binary )
133
133
var mh chunkBasicHeader
134
134
err := decodeChunkBasicHeader (r , nil , & mh )
135
- assert .Nil (t , err )
136
- assert .Equal (t , tc .value , & mh )
135
+ require .Nil (t , err )
136
+ require .Equal (t , tc .value , & mh )
137
137
})
138
138
}
139
139
})
@@ -146,7 +146,7 @@ func TestChunkBasicHeaderError(t *testing.T) {
146
146
fmt : 3 ,
147
147
chunkStreamID : 65600 ,
148
148
})
149
- assert .EqualError (t , err , "Chunk stream id is out of range: 65600 must be in range [2, 65599]" )
149
+ require .EqualError (t , err , "Chunk stream id is out of range: 65600 must be in range [2, 65599]" )
150
150
})
151
151
152
152
t .Run ("Out of range(under)" , func (t * testing.T ) {
@@ -155,7 +155,7 @@ func TestChunkBasicHeaderError(t *testing.T) {
155
155
fmt : 3 ,
156
156
chunkStreamID : 1 ,
157
157
})
158
- assert .EqualError (t , err , "Chunk stream id is out of range: 1 must be in range [2, 65599]" )
158
+ require .EqualError (t , err , "Chunk stream id is out of range: 1 must be in range [2, 65599]" )
159
159
})
160
160
}
161
161
@@ -367,8 +367,8 @@ func TestChunkMessageHeader(t *testing.T) {
367
367
368
368
buf := new (bytes.Buffer )
369
369
err := encodeChunkMessageHeader (buf , tc .fmt , tc .value )
370
- assert .Nil (t , err )
371
- assert .Equal (t , tc .binary , buf .Bytes ())
370
+ require .Nil (t , err )
371
+ require .Equal (t , tc .binary , buf .Bytes ())
372
372
})
373
373
}
374
374
})
@@ -383,8 +383,8 @@ func TestChunkMessageHeader(t *testing.T) {
383
383
r := bytes .NewReader (tc .binary )
384
384
var mh chunkMessageHeader
385
385
err := decodeChunkMessageHeader (r , tc .fmt , nil , & mh )
386
- assert .Nil (t , err )
387
- assert .Equal (t , tc .value , & mh )
386
+ require .Nil (t , err )
387
+ require .Equal (t , tc .value , & mh )
388
388
})
389
389
}
390
390
})
0 commit comments