@@ -33,33 +33,33 @@ hello world
33
33
-- empty filename line --
34
34
some content
35
35
-- --` ,
36
- parsed : & Archive {
37
- Comment : []byte ("comment1\n comment2\n " ),
38
- Files : []File {
39
- {"file1" , []byte ("File 1 text.\n -- foo ---\n More file 1 text.\n " )},
40
- {"file 2" , []byte ("File 2 text.\n " )},
41
- {"empty" , []byte {}},
42
- {"noNL" , []byte ("hello world\n " )},
43
- {"empty filename line" , []byte ("some content\n -- --\n " )},
44
- },
45
- },
36
+ parsed : & Archive {
37
+ Comment : []byte ("comment1\n comment2\n " ),
38
+ Files : []File {
39
+ {"file1" , []byte ("File 1 text.\n -- foo ---\n More file 1 text.\n " )},
40
+ {"file 2" , []byte ("File 2 text.\n " )},
41
+ {"empty" , []byte {}},
42
+ {"noNL" , []byte ("hello world\n " )},
43
+ {"empty filename line" , []byte ("some content\n -- --\n " )},
44
+ },
45
+ },
46
46
},
47
47
{
48
48
name : "basic CRLF" ,
49
49
text : "comment1\r \n " +
50
- "comment2\r \n " +
51
- "-- file1 --\r \n " +
52
- "File 1 text.\r \n " +
53
- "-- foo ---\r \n " +
54
- "More file 1 text.\r \n " +
55
- "-- file 2 --\r \n " +
56
- "File 2 text.\r \n " +
57
- "-- empty --\r \n " +
58
- "-- noNL --\r \n " +
59
- "hello world\r \n " +
60
- "-- empty filename line --\r \n " +
61
- "some content\r \n " +
62
- "-- --\r \n " ,
50
+ "comment2\r \n " +
51
+ "-- file1 --\r \n " +
52
+ "File 1 text.\r \n " +
53
+ "-- foo ---\r \n " +
54
+ "More file 1 text.\r \n " +
55
+ "-- file 2 --\r \n " +
56
+ "File 2 text.\r \n " +
57
+ "-- empty --\r \n " +
58
+ "-- noNL --\r \n " +
59
+ "hello world\r \n " +
60
+ "-- empty filename line --\r \n " +
61
+ "some content\r \n " +
62
+ "-- --\r \n " ,
63
63
parsed : & Archive {
64
64
Comment : []byte ("comment1\r \n comment2\r \n " ),
65
65
Files : []File {
@@ -71,6 +71,38 @@ some content
71
71
},
72
72
},
73
73
},
74
+ {
75
+ name : "mixed" ,
76
+ text : "comment1\n " +
77
+ "comment2\r \n " +
78
+ "-- file1 --\r \n " +
79
+ "File 1 text.\n " +
80
+ "-- foo ---\r \n " +
81
+ "More file 1 text.\r \n " +
82
+ "-- file 2 --\r \n " +
83
+ "File 2 text.\r \n " +
84
+ "-- file 3 --\r \n " +
85
+ "File 3 text.\r \n " +
86
+ "-- foo ---\r \n " +
87
+ "More file 3 text.\r \n " +
88
+ "-- empty --\r \n " +
89
+ "-- noNL --\r \n " +
90
+ "hello world\r \n " +
91
+ "-- empty filename line --\r \n " +
92
+ "some content\r \n " +
93
+ "-- --\n " ,
94
+ parsed : & Archive {
95
+ Comment : []byte ("comment1\n comment2\r \n " ),
96
+ Files : []File {
97
+ {"file1" , []byte ("File 1 text.\n -- foo ---\r \n More file 1 text.\r \n " )},
98
+ {"file 2" , []byte ("File 2 text.\r \n " )},
99
+ {"file 3" , []byte ("File 3 text.\r \n -- foo ---\r \n More file 3 text.\r \n " )},
100
+ {"empty" , []byte {}},
101
+ {"noNL" , []byte ("hello world\r \n " )},
102
+ {"empty filename line" , []byte ("some content\r \n -- --\n " )},
103
+ },
104
+ },
105
+ },
74
106
}
75
107
for _ , tt := range tests {
76
108
t .Run (tt .name , func (t * testing.T ) {
0 commit comments