1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
package dbus
import "testing"
func TestFormatMatchOptions(t *testing.T) {
opts := []MatchOption{
withMatchType("signal"),
WithMatchSender("org.bluez"),
WithMatchInterface("org.freedesktop.DBus.Properties"),
WithMatchMember("PropertiesChanged"),
WithMatchPathNamespace("/org/bluez/hci0"),
}
want := "type='signal',sender='org.bluez'," +
"interface='org.freedesktop.DBus.Properties'," +
"member='PropertiesChanged',path_namespace='/org/bluez/hci0'"
if have := formatMatchOptions(opts); have != want {
t.Fatalf("formatMatchOptions(%v) = %q, want %q", opts, have, want)
}
}
|