@@ -5,21 +5,20 @@ import (
5
5
"testing"
6
6
7
7
"github.com/stretchr/testify/assert"
8
- "go.mau.fi/util/ptr"
9
8
10
9
"go.mau.fi/mautrix-googlechat/pkg/gchatmeow/proto"
11
10
"go.mau.fi/mautrix-googlechat/pkg/msgconv/gchatfmt"
12
11
)
13
12
14
13
func makeAnnotation (start , length int32 , format proto.FormatMetadata_FormatType ) * proto.Annotation {
15
14
return & proto.Annotation {
16
- Type : proto .AnnotationType_FORMAT_DATA . Enum () ,
17
- StartIndex : ptr . Ptr ( start ) ,
18
- Length : ptr . Ptr ( length ) ,
19
- ChipRenderType : ptr . Ptr ( proto .Annotation_DO_NOT_RENDER ) ,
15
+ Type : proto .AnnotationType_FORMAT_DATA ,
16
+ StartIndex : start ,
17
+ Length : length ,
18
+ ChipRenderType : proto .Annotation_DO_NOT_RENDER ,
20
19
Metadata : & proto.Annotation_FormatMetadata {
21
20
FormatMetadata : & proto.FormatMetadata {
22
- FormatType : format . Enum () ,
21
+ FormatType : format ,
23
22
},
24
23
},
25
24
}
@@ -66,7 +65,7 @@ func TestParse(t *testing.T) {
66
65
for _ , test := range tests {
67
66
t .Run (test .name , func (t * testing.T ) {
68
67
msg := & proto.Message {
69
- TextBody : ptr . Ptr ( test .ins ) ,
68
+ TextBody : test .ins ,
70
69
Annotations : test .ine ,
71
70
}
72
71
parsed := gchatfmt .Parse (context .TODO (), nil , msg )
0 commit comments