-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathresponse_test.go
47 lines (43 loc) · 1.06 KB
/
response_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright 2021 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package commands_test
import (
"encoding/xml"
"testing"
"mellium.im/xmpp/commands"
"mellium.im/xmpp/internal/xmpptest"
)
func TestNoteTypes(t *testing.T) {
xmpptest.RunEncodingTests(t, []xmpptest.EncodingTestCase{
{
Value: &struct {
XMLName xml.Name `xml:"foo"`
Type commands.NoteType `xml:"notetype,attr"`
}{
XMLName: xml.Name{Local: "foo"},
},
XML: `<foo notetype="info"></foo>`,
},
{
Value: &struct {
XMLName xml.Name `xml:"foo"`
Type commands.NoteType `xml:"notetype,attr"`
}{
XMLName: xml.Name{Local: "foo"},
Type: commands.NoteWarn,
},
XML: `<foo notetype="warn"></foo>`,
},
{
Value: &struct {
XMLName xml.Name `xml:"foo"`
Type commands.NoteType `xml:"notetype,attr"`
}{
XMLName: xml.Name{Local: "foo"},
Type: commands.NoteError,
},
XML: `<foo notetype="error"></foo>`,
},
})
}