diff --git a/subscription/subscription_test.go b/subscription/subscription_test.go index 9849b82..e4b4159 100644 --- a/subscription/subscription_test.go +++ b/subscription/subscription_test.go @@ -25,33 +25,36 @@ func assertMatches(topic packets.Topic, topicName string, shouldMatch bool, t *t } func TestSubscribe(t *testing.T) { + t.Parallel() topic, _ := packets.ParseTopic("a/b/c") - assertMatches(topic, "a/b/c", true, t) - assertMatches(topic, "a/c/c", false, t) - assertMatches(topic, "b/b/c", false, t) - assertMatches(topic, "aaa/c/a", false, t) + go assertMatches(topic, "a/b/c", true, t) + go assertMatches(topic, "a/c/c", false, t) + go assertMatches(topic, "b/b/c", false, t) + go assertMatches(topic, "aaa/c/a", false, t) } func TestSingleLevelWildcard(t *testing.T) { + t.Parallel() topic, _ := packets.ParseTopic("a/+/c") - assertMatches(topic, "a/b/c", true, t) - assertMatches(topic, "a/c/c", true, t) - assertMatches(topic, "a/b/d", false, t) - assertMatches(topic, "aaa/c/a", false, t) + go assertMatches(topic, "a/b/c", true, t) + go assertMatches(topic, "a/c/c", true, t) + go assertMatches(topic, "a/b/d", false, t) + go assertMatches(topic, "aaa/c/a", false, t) topic, _ = packets.ParseTopic("+/+/+") - assertMatches(topic, "a/b/c", true, t) - assertMatches(topic, "a/c/c", true, t) - assertMatches(topic, "a/b/d/e", false, t) - assertMatches(topic, "c/a", true, t) + go assertMatches(topic, "a/b/c", true, t) + go assertMatches(topic, "a/c/c", true, t) + go assertMatches(topic, "a/b/d/e", false, t) + go assertMatches(topic, "c/a", true, t) } func TestMultiLevelWildcard(t *testing.T) { + t.Parallel() topic, _ := packets.ParseTopic("a/b/c/#") - assertMatches(topic, "a/b/c", true, t) - assertMatches(topic, "a/b/c/a", true, t) - assertMatches(topic, "a/b/c/d", true, t) - assertMatches(topic, "a/b/c/f", true, t) + go assertMatches(topic, "a/b/c", true, t) + go assertMatches(topic, "a/b/c/a", true, t) + go assertMatches(topic, "a/b/c/d", true, t) + go assertMatches(topic, "a/b/c/f", true, t) - assertMatches(topic, "a/b/d/a", false, t) + go assertMatches(topic, "a/b/d/a", false, t) }