chore: improve testing and increase coverage (#794)

This diff improves testing and increases coverage inside the
./internal/netxlite and ./internal/tracex packages.

See https://github.com/ooni/probe/issues/2121
This commit is contained in:
Simone Basso 2022-06-04 14:58:48 +02:00 committed by GitHub
commit d5249a6cf7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 621 additions and 348 deletions

View file

@ -177,6 +177,14 @@ func TestQUICDialerSaver(t *testing.T) {
})
}
func TestWrapQUICListener(t *testing.T) {
var saver *Saver
ql := &mocks.QUICListener{}
if saver.WrapQUICListener(ql) != ql {
t.Fatal("unexpected result")
}
}
func TestQUICListenerSaver(t *testing.T) {
t.Run("on failure", func(t *testing.T) {
expected := errors.New("mocked error")