packagefilterimport"testing"funcTestFilters(t*testing.T){varsuccessboolvarfailureboolfm:=New()fm.Start()fm.Install(Generic{Str1:"hello",Fn:func(datainterface{}){success=data.(bool)},})fm.Install(Generic{Str1:"hello1",Str2:"hello",Fn:func(datainterface{}){failure=true},})fm.Notify(Generic{Str1:"hello"},true)fm.Stop()if!success{t.Error("expected 'hello' to be posted")}iffailure{t.Error("hello1 was triggered")}}