19
19
# https://github.com/SaberUK/ircparser/tree/master/test
20
20
21
21
tests :
22
+ # the desc string holds a description of the test, if it exists
23
+
22
24
# the atoms dict has the keys:
23
25
# * tags: tags dict
24
26
# tags with no equals sign have a value of null in this file
33
35
34
36
# matches is a list of messages that match
35
37
36
- # simple
37
- - atoms :
38
+ # simple tests
39
+ - desc : Simple test with verb and params.
40
+ atoms :
38
41
verb : " foo"
39
42
params :
40
43
- " bar"
@@ -44,8 +47,26 @@ tests:
44
47
- " foo bar baz asdf"
45
48
- " foo bar baz :asdf"
46
49
50
+ # with no regular params
51
+ - desc : Simple test with source and no params.
52
+ atoms :
53
+ source : " src"
54
+ verb : " AWAY"
55
+ matches :
56
+ - " :src AWAY"
57
+
58
+ - desc : Simple test with source and empty trailing param.
59
+ atoms :
60
+ source : " src"
61
+ verb : " AWAY"
62
+ params :
63
+ - " "
64
+ matches :
65
+ - " :src AWAY :"
66
+
47
67
# with source
48
- - atoms :
68
+ - desc : Simple test with source.
69
+ atoms :
49
70
source : " coolguy"
50
71
verb : " foo"
51
72
params :
57
78
- " :coolguy foo bar baz :asdf"
58
79
59
80
# with trailing param
60
- - atoms :
81
+ - desc : Simple test with trailing param.
82
+ atoms :
61
83
verb : " foo"
62
84
params :
63
85
- " bar"
66
88
matches :
67
89
- " foo bar baz :asdf quux"
68
90
69
- - atoms :
91
+ - desc : Simple test with empty trailing param.
92
+ atoms :
70
93
verb : " foo"
71
94
params :
72
95
- " bar"
75
98
matches :
76
99
- " foo bar baz :"
77
100
78
- - atoms :
101
+ - desc : Simple test with trailing param containing colon.
102
+ atoms :
79
103
verb : " foo"
80
104
params :
81
105
- " bar"
@@ -85,7 +109,8 @@ tests:
85
109
- " foo bar baz ::asdf"
86
110
87
111
# with source and trailing param
88
- - atoms :
112
+ - desc : Test with source and trailing param.
113
+ atoms :
89
114
source : " coolguy"
90
115
verb : " foo"
91
116
params :
@@ -95,7 +120,8 @@ tests:
95
120
matches :
96
121
- " :coolguy foo bar baz :asdf quux"
97
122
98
- - atoms :
123
+ - desc : Test with trailing containing beginning+end whitespace.
124
+ atoms :
99
125
source : " coolguy"
100
126
verb : " foo"
101
127
params :
@@ -105,7 +131,8 @@ tests:
105
131
matches :
106
132
- " :coolguy foo bar baz : asdf quux "
107
133
108
- - atoms :
134
+ - desc : Test with trailing containing what looks like another trailing param.
135
+ atoms :
109
136
source : " coolguy"
110
137
verb : " PRIVMSG"
111
138
params :
@@ -114,7 +141,8 @@ tests:
114
141
matches :
115
142
- " :coolguy PRIVMSG bar :lol :) "
116
143
117
- - atoms :
144
+ - desc : Simple test with source and empty trailing.
145
+ atoms :
118
146
source : " coolguy"
119
147
verb : " foo"
120
148
params :
@@ -124,7 +152,8 @@ tests:
124
152
matches :
125
153
- " :coolguy foo bar baz :"
126
154
127
- - atoms :
155
+ - desc : Trailing contains only spaces.
156
+ atoms :
128
157
source : " coolguy"
129
158
verb : " foo"
130
159
params :
@@ -134,8 +163,20 @@ tests:
134
163
matches :
135
164
- " :coolguy foo bar baz : "
136
165
166
+ - desc : Param containing tab (tab is not considered SPACE for message splitting).
167
+ atoms :
168
+ source : " coolguy"
169
+ verb : " foo"
170
+ params :
171
+ - " b\t ar"
172
+ - " baz"
173
+ matches :
174
+ - " :coolguy foo b\t ar baz"
175
+ - " :coolguy foo b\t ar :baz"
176
+
137
177
# with tags
138
- - atoms :
178
+ - desc : Tag with no value and space-filled trailing.
179
+ atoms :
139
180
tags :
140
181
" asd " : null
141
182
source : " coolguy"
@@ -147,7 +188,8 @@ tests:
147
188
matches :
148
189
- " @asd :coolguy foo bar baz : "
149
190
150
- - atoms :
191
+ - desc : Tags with escaped values.
192
+ atoms :
151
193
verb : " foo"
152
194
tags :
153
195
" a " : " b\\ and\n k"
@@ -156,7 +198,8 @@ tests:
156
198
- " @a=b\\\\ and\\ nk;d=gh\\ :764 foo"
157
199
- " @d=gh\\ :764;a=b\\\\ and\\ nk foo"
158
200
159
- - atoms :
201
+ - desc : Tags with escaped values and params.
202
+ atoms :
160
203
verb : " foo"
161
204
tags :
162
205
" a " : " b\\ and\n k"
@@ -170,35 +213,10 @@ tests:
170
213
- " @d=gh\\ :764;a=b\\\\ and\\ nk foo par1 par2"
171
214
- " @d=gh\\ :764;a=b\\\\ and\\ nk foo par1 :par2"
172
215
173
- - atoms :
216
+ - desc : Tag with long, strange values (including LF and newline).
217
+ atoms :
174
218
tags :
175
219
foo : " \\\\ ;\\ s \r\n "
176
220
verb : " COMMAND"
177
221
matches :
178
222
- " @foo=\\\\\\\\\\ :\\\\ s\\ s\\ r\\ n COMMAND"
179
-
180
- # with and without last param
181
- - atoms :
182
- source : " src"
183
- verb : " AWAY"
184
- matches :
185
- - " :src AWAY"
186
-
187
- - atoms :
188
- source : " src"
189
- verb : " AWAY"
190
- params :
191
- - " "
192
- matches :
193
- - " :src AWAY :"
194
-
195
- # tab is not considered <SPACE>
196
- - atoms :
197
- source : " coolguy"
198
- verb : " foo"
199
- params :
200
- - " b\t ar"
201
- - " baz"
202
- matches :
203
- - " :coolguy foo b\t ar baz"
204
- - " :coolguy foo b\t ar :baz"
0 commit comments