optimize Fatalf with the expectedError
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
This commit is contained in:
parent
4617b66c90
commit
6305817184
1 changed files with 3 additions and 2 deletions
|
@ -195,10 +195,11 @@ func TestResumableRequestReaderWithServerDoesntSupportByteRanges(t *testing.T) {
|
|||
}
|
||||
defer resreq.Close()
|
||||
|
||||
expectedError := "the server doesn't support byte ranges"
|
||||
buf := make([]byte, 2)
|
||||
_, err = resreq.Read(buf)
|
||||
if err == nil || err.Error() != "the server doesn't support byte ranges" {
|
||||
t.Fatalf("Expected an error 'the server doesn't support byte ranges', got %v", err)
|
||||
if err == nil || err.Error() != expectedError {
|
||||
t.Fatalf("Expected an error '%s', got %v", expectedError, err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue