This repository has been archived on 2024-08-02. You can view files and clone it, but cannot push or open issues or pull requests.
orion/emlid/discovery_test.go

30 lines
496 B
Go

package emlid
import (
"testing"
"time"
)
func TestDiscovery(t *testing.T) {
if !*runDiscoveryIntegrationTests {
t.Skip("To run this test, use: go test -discovery-integration")
}
services, err := Discover(3 * time.Second)
if err != nil {
t.Fatal(err)
}
if g, e := len(services), 1; g != e {
t.Fatalf("len(services): got '%d', expected '%d'", g, e)
}
s := services[0]
if g, e := s.Name, "reach"; g != e {
t.Errorf("services[0].Name: got '%s', expected '%s'", g, e)
}
}