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