feat(errorsx): cover more syscall errors and add tests (#430)
* feat(errorsx): cover more syscall errors and add tests Part of https://github.com/ooni/probe/issues/1505 * fix tests
This commit is contained in:
parent
3747598b4a
commit
14c1640f7f
7 changed files with 293 additions and 48 deletions
|
|
@ -54,7 +54,7 @@ func TestToFailureString(t *testing.T) {
|
|||
}
|
||||
})
|
||||
t.Run("for canceled", func(t *testing.T) {
|
||||
if toFailureString(syscall.ECANCELED) != FailureInterrupted {
|
||||
if toFailureString(syscall.ECANCELED) != FailureOperationCanceled {
|
||||
t.Fatal("unexpected results")
|
||||
}
|
||||
})
|
||||
|
|
@ -74,7 +74,7 @@ func TestToFailureString(t *testing.T) {
|
|||
}
|
||||
})
|
||||
t.Run("for system timeout", func(t *testing.T) {
|
||||
if toFailureString(syscall.ETIMEDOUT) != FailureGenericTimeoutError {
|
||||
if toFailureString(syscall.ETIMEDOUT) != FailureTimedOut {
|
||||
t.Fatal("unexpected results")
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue