2017-01-03 03:00:16 +08:00
|
|
|
package firmata
|
|
|
|
|
|
|
|
import (
|
2017-02-02 23:10:09 +08:00
|
|
|
"strings"
|
2017-01-03 03:00:16 +08:00
|
|
|
"testing"
|
|
|
|
|
|
|
|
"gobot.io/x/gobot"
|
|
|
|
"gobot.io/x/gobot/gobottest"
|
|
|
|
)
|
|
|
|
|
|
|
|
var _ gobot.Adaptor = (*TCPAdaptor)(nil)
|
|
|
|
|
|
|
|
func initTestTCPAdaptor() *TCPAdaptor {
|
|
|
|
a := NewTCPAdaptor("localhost:4567")
|
|
|
|
return a
|
|
|
|
}
|
|
|
|
|
2017-01-03 05:18:12 +08:00
|
|
|
func TestFirmataTCPAdaptor(t *testing.T) {
|
2017-01-03 03:00:16 +08:00
|
|
|
a := initTestTCPAdaptor()
|
2017-02-02 23:10:09 +08:00
|
|
|
gobottest.Assert(t, strings.HasPrefix(a.Name(), "TCPFirmata"), true)
|
2017-01-03 03:00:16 +08:00
|
|
|
}
|