Skip to content

Commit 647cf9e

Browse files
committed
test: Add test for escaped semicolons in property parameters
1 parent 0f8a325 commit 647cf9e

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

calendar_test.go

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package ics
22

33
import (
4-
"github.com/stretchr/testify/assert"
54
"io"
65
"io/ioutil"
76
"os"
@@ -11,6 +10,8 @@ import (
1110
"testing"
1211
"time"
1312
"unicode/utf8"
13+
14+
"github.com/stretchr/testify/assert"
1415
)
1516

1617
func TestTimeParsing(t *testing.T) {
@@ -315,6 +316,31 @@ DESCRIPTION:blablablablablablablablablablablablablablablabltesttesttest
315316
CLASS:PUBLIC
316317
END:VEVENT
317318
END:VCALENDAR
319+
`,
320+
},
321+
{
322+
name: "test semicolon in attendee property parameter",
323+
input: `BEGIN:VCALENDAR
324+
VERSION:2.0
325+
X-CUSTOM-FIELD:test
326+
PRODID:-//arran4//Golang ICS Library
327+
DESCRIPTION:test
328+
BEGIN:VEVENT
329+
ATTENDEE;CN=Test\;User:mailto:user@example.com
330+
CLASS:PUBLIC
331+
END:VEVENT
332+
END:VCALENDAR
333+
`,
334+
output: `BEGIN:VCALENDAR
335+
VERSION:2.0
336+
X-CUSTOM-FIELD:test
337+
PRODID:-//arran4//Golang ICS Library
338+
DESCRIPTION:test
339+
BEGIN:VEVENT
340+
ATTENDEE;CN=Test\;User:mailto:user@example.com
341+
CLASS:PUBLIC
342+
END:VEVENT
343+
END:VCALENDAR
318344
`,
319345
},
320346
}

0 commit comments

Comments
 (0)