Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add more tests #2812

Merged
merged 2 commits into from
Jan 23, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: add more tests
  • Loading branch information
kevwan committed Jan 23, 2023
commit be506b72a14b1ff6d2193289a694dd0791e9ff15
12 changes: 8 additions & 4 deletions zrpc/resolver/internal/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ package internal
import (
"testing"

"github.com/stretchr/testify/assert"
"google.golang.org/grpc/resolver"
"google.golang.org/grpc/serviceconfig"
)

func TestNopResolver(t *testing.T) {
// make sure ResolveNow & Close don't panic
var r nopResolver
r.ResolveNow(resolver.ResolveNowOptions{})
r.Close()
assert.NotPanics(t, func() {
RegisterResolver()
// make sure ResolveNow & Close don't panic
var r nopResolver
r.ResolveNow(resolver.ResolveNowOptions{})
r.Close()
})
}

type mockedClientConn struct {
Expand Down