File: match_test.go

package info (click to toggle)
golang-dbus 5.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports, bookworm-proposed-updates, forky, sid, trixie
  • size: 592 kB
  • sloc: makefile: 2
file content (19 lines) | stat: -rw-r--r-- 593 bytes parent folder | download | duplicates (2)
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)
	}
}