mautrix/go

maunium.net/go/mautrix/pushrules tests fail

Closed this issue · 1 comments

Running tests in "maunium.net/go/mautrix/pushrules" fails due to skew between that package and the event package.

$ go test
# maunium.net/go/mautrix/pushrules_test [maunium.net/go/mautrix/pushrules.test]
./condition_displayname_test.go:29:3: unknown field 'MsgType' in struct literal of type event.Content
./condition_displayname_test.go:30:3: unknown field 'Body' in struct literal of type event.Content
./condition_displayname_test.go:38:3: unknown field 'MsgType' in struct literal of type event.Content
./condition_displayname_test.go:39:3: unknown field 'Body' in struct literal of type event.Content
./condition_displayname_test.go:48:3: unknown field 'MsgType' in struct literal of type event.Content
./condition_displayname_test.go:49:3: unknown field 'Body' in struct literal of type event.Content
./condition_test.go:48:4: unknown field 'MsgType' in struct literal of type event.Content
./condition_test.go:49:4: unknown field 'Body' in struct literal of type event.Content
./condition_test.go:94:22: undefined: event.Member
./condition_test.go:101:29: undefined: event.Member
./condition_test.go:101:29: too many errors
FAIL	maunium.net/go/mautrix/pushrules [build failed]

I have attempted to fix this by wrapping the MsgType and Body fields in Parsed: event.MessageEventContent and renaming uses of event.Member to event.MemberEventContent, but while this now builds there are obviously semantic changes that I am missing.

$ go test
--- FAIL: TestPushCondition_Match_DisplayName (0.00s)
    condition_displayname_test.go:35: 
        	Error Trace:	condition_displayname_test.go:35
        	Error:      	Should be true
        	Test:       	TestPushCondition_Match_DisplayName
--- FAIL: TestPushRule_Match_Content (0.00s)
    rule_test.go:107: 
        	Error Trace:	rule_test.go:107
        	Error:      	Should be true
        	Test:       	TestPushRule_Match_Content
--- FAIL: TestPushRule_Match_Content_ImplicitGlob (0.00s)
    rule_test.go:139: 
        	Error Trace:	rule_test.go:139
        	Error:      	Should be true
        	Test:       	TestPushRule_Match_Content_ImplicitGlob
FAIL

Thanks