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:
Simone Basso 2021-07-08 12:23:37 +02:00 committed by GitHub
commit 14c1640f7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 293 additions and 48 deletions

View file

@ -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")
}
})