net-imap 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile +2 -0
- data/lib/net/imap/errors.rb +20 -0
- data/lib/net/imap/response_data.rb +46 -6
- data/lib/net/imap/response_parser/parser_utils.rb +10 -0
- data/lib/net/imap/response_parser.rb +608 -352
- data/lib/net/imap/sasl/authenticators.rb +2 -2
- data/lib/net/imap/sasl/xoauth2_authenticator.rb +1 -1
- data/lib/net/imap.rb +22 -24
- data/net-imap.gemspec +3 -2
- data/rakelib/benchmarks.rake +98 -0
- metadata +3 -6
- data/benchmarks/generate_parser_benchmarks +0 -52
- data/benchmarks/parser.yml +0 -578
- data/benchmarks/stringprep.yml +0 -65
- data/benchmarks/table-regexps.yml +0 -39
data/benchmarks/parser.yml
DELETED
@@ -1,578 +0,0 @@
|
|
1
|
-
---
|
2
|
-
prelude: |2
|
3
|
-
require "yaml"
|
4
|
-
require "net/imap"
|
5
|
-
|
6
|
-
def load_response(file, name)
|
7
|
-
YAML.unsafe_load_file(file).dig(:tests, name, :response)
|
8
|
-
.force_encoding "ASCII-8BIT" \
|
9
|
-
or abort "ERRORO: missing %p fixture data in %p" % [name, file]
|
10
|
-
end
|
11
|
-
|
12
|
-
parser = Net::IMAP::ResponseParser.new
|
13
|
-
benchmark:
|
14
|
-
- name: NAMESPACE_rfc2342_example_5.1
|
15
|
-
prelude: |2
|
16
|
-
response = load_response("../test/net/imap/fixtures/response_parser/namespace_responses.yml",
|
17
|
-
"NAMESPACE_rfc2342_example_5.1")
|
18
|
-
script: parser.parse(response)
|
19
|
-
- name: NAMESPACE_rfc2342_example_5.2
|
20
|
-
prelude: |2
|
21
|
-
response = load_response("../test/net/imap/fixtures/response_parser/namespace_responses.yml",
|
22
|
-
"NAMESPACE_rfc2342_example_5.2")
|
23
|
-
script: parser.parse(response)
|
24
|
-
- name: NAMESPACE_rfc2342_example_5.3
|
25
|
-
prelude: |2
|
26
|
-
response = load_response("../test/net/imap/fixtures/response_parser/namespace_responses.yml",
|
27
|
-
"NAMESPACE_rfc2342_example_5.3")
|
28
|
-
script: parser.parse(response)
|
29
|
-
- name: NAMESPACE_rfc2342_example_5.4
|
30
|
-
prelude: |2
|
31
|
-
response = load_response("../test/net/imap/fixtures/response_parser/namespace_responses.yml",
|
32
|
-
"NAMESPACE_rfc2342_example_5.4")
|
33
|
-
script: parser.parse(response)
|
34
|
-
- name: NAMESPACE_rfc2342_example_5.5
|
35
|
-
prelude: |2
|
36
|
-
response = load_response("../test/net/imap/fixtures/response_parser/namespace_responses.yml",
|
37
|
-
"NAMESPACE_rfc2342_example_5.5")
|
38
|
-
script: parser.parse(response)
|
39
|
-
- name: NAMESPACE_rfc2342_example_5.6
|
40
|
-
prelude: |2
|
41
|
-
response = load_response("../test/net/imap/fixtures/response_parser/namespace_responses.yml",
|
42
|
-
"NAMESPACE_rfc2342_example_5.6")
|
43
|
-
script: parser.parse(response)
|
44
|
-
- name: NAMESPACE_rfc2342_example_5.7
|
45
|
-
prelude: |2
|
46
|
-
response = load_response("../test/net/imap/fixtures/response_parser/namespace_responses.yml",
|
47
|
-
"NAMESPACE_rfc2342_example_5.7")
|
48
|
-
script: parser.parse(response)
|
49
|
-
- name: NAMESPACE_rfc2342_example_5.9
|
50
|
-
prelude: |2
|
51
|
-
response = load_response("../test/net/imap/fixtures/response_parser/namespace_responses.yml",
|
52
|
-
"NAMESPACE_rfc2342_example_5.9")
|
53
|
-
script: parser.parse(response)
|
54
|
-
- name: NAMESPACE_rfc9051_6.3.10_example_8
|
55
|
-
prelude: |2
|
56
|
-
response = load_response("../test/net/imap/fixtures/response_parser/namespace_responses.yml",
|
57
|
-
"NAMESPACE_rfc9051_6.3.10_example_8")
|
58
|
-
script: parser.parse(response)
|
59
|
-
- name: acl_response
|
60
|
-
prelude: |2
|
61
|
-
response = load_response("../test/net/imap/fixtures/response_parser/acl_responses.yml",
|
62
|
-
"test_acl_response")
|
63
|
-
script: parser.parse(response)
|
64
|
-
- name: bodystructure_bug11128_ext_mpart_without_lang
|
65
|
-
prelude: |2
|
66
|
-
response = load_response("../test/net/imap/fixtures/response_parser/body_structure_responses.yml",
|
67
|
-
"test_bodystructure_bug11128_ext_mpart_without_lang")
|
68
|
-
script: parser.parse(response)
|
69
|
-
- name: bodystructure_bug7146_msg_delivery_status
|
70
|
-
prelude: |2
|
71
|
-
response = load_response("../test/net/imap/fixtures/response_parser/body_structure_responses.yml",
|
72
|
-
"test_bodystructure_bug7146_msg_delivery_status")
|
73
|
-
script: parser.parse(response)
|
74
|
-
- name: bodystructure_bug7147_message_rfc822_attachment
|
75
|
-
prelude: |2
|
76
|
-
response = load_response("../test/net/imap/fixtures/response_parser/body_structure_responses.yml",
|
77
|
-
"test_bodystructure_bug7147_message_rfc822_attachment")
|
78
|
-
script: parser.parse(response)
|
79
|
-
- name: bodystructure_bug8167_delivery_status_with_extra_data
|
80
|
-
prelude: |2
|
81
|
-
response = load_response("../test/net/imap/fixtures/response_parser/body_structure_responses.yml",
|
82
|
-
"test_bodystructure_bug8167_delivery_status_with_extra_data")
|
83
|
-
script: parser.parse(response)
|
84
|
-
- name: bodystructure_mixed_boundary
|
85
|
-
prelude: |2
|
86
|
-
response = load_response("../test/net/imap/fixtures/response_parser/body_structure_responses.yml",
|
87
|
-
"test_bodystructure_mixed_boundary")
|
88
|
-
script: parser.parse(response)
|
89
|
-
- name: continuation_request_without_response_text
|
90
|
-
prelude: |2
|
91
|
-
response = load_response("../test/net/imap/fixtures/response_parser/continuation_requests.yml",
|
92
|
-
"test_continuation_request_without_response_text")
|
93
|
-
script: parser.parse(response)
|
94
|
-
- name: fetch_msg_att_flags_and_uid
|
95
|
-
prelude: |2
|
96
|
-
response = load_response("../test/net/imap/fixtures/response_parser/fetch_responses.yml",
|
97
|
-
"test_fetch_msg_att_flags_and_uid")
|
98
|
-
script: parser.parse(response)
|
99
|
-
- name: fetch_msg_att_modseq
|
100
|
-
prelude: |2
|
101
|
-
response = load_response("../test/net/imap/fixtures/response_parser/fetch_responses.yml",
|
102
|
-
"test_fetch_msg_att_modseq")
|
103
|
-
script: parser.parse(response)
|
104
|
-
- name: fetch_msg_att_rfc822
|
105
|
-
prelude: |2
|
106
|
-
response = load_response("../test/net/imap/fixtures/response_parser/fetch_responses.yml",
|
107
|
-
"test_fetch_msg_att_rfc822")
|
108
|
-
script: parser.parse(response)
|
109
|
-
- name: fetch_msg_att_uid
|
110
|
-
prelude: |2
|
111
|
-
response = load_response("../test/net/imap/fixtures/response_parser/fetch_responses.yml",
|
112
|
-
"test_fetch_msg_att_uid")
|
113
|
-
script: parser.parse(response)
|
114
|
-
- name: id_gmail
|
115
|
-
prelude: |2
|
116
|
-
response = load_response("../test/net/imap/fixtures/response_parser/id_responses.yml",
|
117
|
-
"test_id_gmail")
|
118
|
-
script: parser.parse(response)
|
119
|
-
- name: id_rfc2971_example_3.1_nil
|
120
|
-
prelude: |2
|
121
|
-
response = load_response("../test/net/imap/fixtures/response_parser/id_responses.yml",
|
122
|
-
"test_id_rfc2971_example_3.1_nil")
|
123
|
-
script: parser.parse(response)
|
124
|
-
- name: id_rfc2971_example_3.2_cyrus
|
125
|
-
prelude: |2
|
126
|
-
response = load_response("../test/net/imap/fixtures/response_parser/id_responses.yml",
|
127
|
-
"test_id_rfc2971_example_3.2_cyrus")
|
128
|
-
script: parser.parse(response)
|
129
|
-
- name: invalid_bodystructure_bug7153_mixed
|
130
|
-
prelude: |2
|
131
|
-
response = load_response("../test/net/imap/fixtures/response_parser/body_structure_responses.yml",
|
132
|
-
"test_invalid_bodystructure_bug7153_mixed")
|
133
|
-
script: parser.parse(response)
|
134
|
-
- name: invalid_bodystructure_message_sent_as_basic
|
135
|
-
prelude: |2
|
136
|
-
response = load_response("../test/net/imap/fixtures/response_parser/body_structure_responses.yml",
|
137
|
-
"test_invalid_bodystructure_message_sent_as_basic")
|
138
|
-
script: parser.parse(response)
|
139
|
-
- name: invalid_capability_extra_space_at_end
|
140
|
-
prelude: |2
|
141
|
-
response = load_response("../test/net/imap/fixtures/response_parser/capability_responses.yml",
|
142
|
-
"test_invalid_capability_extra_space_at_end")
|
143
|
-
script: parser.parse(response)
|
144
|
-
- name: invalid_fetch_msg_att_extra_space
|
145
|
-
prelude: |2
|
146
|
-
response = load_response("../test/net/imap/fixtures/response_parser/fetch_responses.yml",
|
147
|
-
"test_invalid_fetch_msg_att_extra_space")
|
148
|
-
script: parser.parse(response)
|
149
|
-
- name: invalid_fetch_msg_att_rfc822_with_brackets
|
150
|
-
prelude: |2
|
151
|
-
response = load_response("../test/net/imap/fixtures/response_parser/fetch_responses.yml",
|
152
|
-
"test_invalid_fetch_msg_att_rfc822_with_brackets")
|
153
|
-
script: parser.parse(response)
|
154
|
-
- name: invalid_noop_response_is_ignored
|
155
|
-
prelude: |2
|
156
|
-
response = load_response("../test/net/imap/fixtures/response_parser/quirky_behaviors.yml",
|
157
|
-
"test_invalid_noop_response_is_ignored")
|
158
|
-
script: parser.parse(response)
|
159
|
-
- name: invalid_search_response_multiple_result_with_trailing_space
|
160
|
-
prelude: |2
|
161
|
-
response = load_response("../test/net/imap/fixtures/response_parser/search_responses.yml",
|
162
|
-
"test_invalid_search_response_multiple_result_with_trailing_space")
|
163
|
-
script: parser.parse(response)
|
164
|
-
- name: invalid_search_response_single_result_with_trailing_space
|
165
|
-
prelude: |2
|
166
|
-
response = load_response("../test/net/imap/fixtures/response_parser/search_responses.yml",
|
167
|
-
"test_invalid_search_response_single_result_with_trailing_space")
|
168
|
-
script: parser.parse(response)
|
169
|
-
- name: invalid_status_response_trailing_space
|
170
|
-
prelude: |2
|
171
|
-
response = load_response("../test/net/imap/fixtures/response_parser/status_responses.yml",
|
172
|
-
"test_invalid_status_response_trailing_space")
|
173
|
-
script: parser.parse(response)
|
174
|
-
- name: invalid_thread_empty_response
|
175
|
-
prelude: |2
|
176
|
-
response = load_response("../test/net/imap/fixtures/response_parser/thread_responses.yml",
|
177
|
-
"test_invalid_thread_empty_response")
|
178
|
-
script: parser.parse(response)
|
179
|
-
- name: list_with_various_flag_types_and_capitalizations
|
180
|
-
prelude: |2
|
181
|
-
response = load_response("../test/net/imap/fixtures/response_parser/list_responses.yml",
|
182
|
-
"test_list_with_various_flag_types_and_capitalizations")
|
183
|
-
script: parser.parse(response)
|
184
|
-
- name: resp_code_ALREADYEXISTS_rfc9051_7.1_example
|
185
|
-
prelude: |2
|
186
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
187
|
-
"test_resp_code_ALREADYEXISTS_rfc9051_7.1_example")
|
188
|
-
script: parser.parse(response)
|
189
|
-
- name: resp_code_APPENDUID_rfc9051_6.3.12_example
|
190
|
-
prelude: |2
|
191
|
-
response = load_response("../test/net/imap/fixtures/response_parser/uidplus_extension.yml",
|
192
|
-
"test_resp_code_APPENDUID_rfc9051_6.3.12_example")
|
193
|
-
script: parser.parse(response)
|
194
|
-
- name: resp_code_APPENDUID_with_MULTIAPPEND_compatibility
|
195
|
-
prelude: |2
|
196
|
-
response = load_response("../test/net/imap/fixtures/response_parser/uidplus_extension.yml",
|
197
|
-
"test_resp_code_APPENDUID_with_MULTIAPPEND_compatibility")
|
198
|
-
script: parser.parse(response)
|
199
|
-
- name: resp_code_AUTHENTICATIONFAILED_rfc9051_7.1_example
|
200
|
-
prelude: |2
|
201
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
202
|
-
"test_resp_code_AUTHENTICATIONFAILED_rfc9051_7.1_example")
|
203
|
-
script: parser.parse(response)
|
204
|
-
- name: resp_code_AUTHORIZATIONFAILED_rfc9051_7.1_example_1
|
205
|
-
prelude: |2
|
206
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
207
|
-
"test_resp_code_AUTHORIZATIONFAILED_rfc9051_7.1_example_1")
|
208
|
-
script: parser.parse(response)
|
209
|
-
- name: resp_code_AUTHORIZATIONFAILED_rfc9051_7.1_example_2
|
210
|
-
prelude: |2
|
211
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
212
|
-
"test_resp_code_AUTHORIZATIONFAILED_rfc9051_7.1_example_2")
|
213
|
-
script: parser.parse(response)
|
214
|
-
- name: resp_code_BADCHARSET_rfc9051_6.4.4.4_example_modified
|
215
|
-
prelude: |2
|
216
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
217
|
-
"test_resp_code_BADCHARSET_rfc9051_6.4.4.4_example_modified")
|
218
|
-
script: parser.parse(response)
|
219
|
-
- name: resp_code_BADCHARSET_with_astrings
|
220
|
-
prelude: |2
|
221
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
222
|
-
"test_resp_code_BADCHARSET_with_astrings")
|
223
|
-
script: parser.parse(response)
|
224
|
-
- name: resp_code_CANNOT_rfc9051_7.1_example
|
225
|
-
prelude: |2
|
226
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
227
|
-
"test_resp_code_CANNOT_rfc9051_7.1_example")
|
228
|
-
script: parser.parse(response)
|
229
|
-
- name: resp_code_CAPABILITY_rfc9051_6.2.2_example
|
230
|
-
prelude: |2
|
231
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
232
|
-
"test_resp_code_CAPABILITY_rfc9051_6.2.2_example")
|
233
|
-
script: parser.parse(response)
|
234
|
-
- name: resp_code_CAPABILITY_with_valid_atoms
|
235
|
-
prelude: |2
|
236
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
237
|
-
"test_resp_code_CAPABILITY_with_valid_atoms")
|
238
|
-
script: parser.parse(response)
|
239
|
-
- name: resp_code_CLIENTBUG_rfc9051_7.1_example
|
240
|
-
prelude: |2
|
241
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
242
|
-
"test_resp_code_CLIENTBUG_rfc9051_7.1_example")
|
243
|
-
script: parser.parse(response)
|
244
|
-
- name: resp_code_CLOSED
|
245
|
-
prelude: |2
|
246
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
247
|
-
"test_resp_code_CLOSED")
|
248
|
-
script: parser.parse(response)
|
249
|
-
- name: resp_code_CONTACTADMIN_rfc9051_7.1_example
|
250
|
-
prelude: |2
|
251
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
252
|
-
"test_resp_code_CONTACTADMIN_rfc9051_7.1_example")
|
253
|
-
script: parser.parse(response)
|
254
|
-
- name: resp_code_COPYUID_rfc9051_6.3.12_example
|
255
|
-
prelude: |2
|
256
|
-
response = load_response("../test/net/imap/fixtures/response_parser/uidplus_extension.yml",
|
257
|
-
"test_resp_code_COPYUID_rfc9051_6.3.12_example")
|
258
|
-
script: parser.parse(response)
|
259
|
-
- name: resp_code_COPYUID_with_reversed_ranges_and_mixed_case
|
260
|
-
prelude: |2
|
261
|
-
response = load_response("../test/net/imap/fixtures/response_parser/uidplus_extension.yml",
|
262
|
-
"test_resp_code_COPYUID_with_reversed_ranges_and_mixed_case")
|
263
|
-
script: parser.parse(response)
|
264
|
-
- name: resp_code_CORRUPTION_rfc9051_7.1_example
|
265
|
-
prelude: |2
|
266
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
267
|
-
"test_resp_code_CORRUPTION_rfc9051_7.1_example")
|
268
|
-
script: parser.parse(response)
|
269
|
-
- name: resp_code_EXPIRED_rfc9051_7.1_example
|
270
|
-
prelude: |2
|
271
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
272
|
-
"test_resp_code_EXPIRED_rfc9051_7.1_example")
|
273
|
-
script: parser.parse(response)
|
274
|
-
- name: resp_code_EXPUNGEISSUED_rfc9051_7.1_example
|
275
|
-
prelude: |2
|
276
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
277
|
-
"test_resp_code_EXPUNGEISSUED_rfc9051_7.1_example")
|
278
|
-
script: parser.parse(response)
|
279
|
-
- name: resp_code_HASCHILDREN_rfc9051_7.1_example
|
280
|
-
prelude: |2
|
281
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
282
|
-
"test_resp_code_HASCHILDREN_rfc9051_7.1_example")
|
283
|
-
script: parser.parse(response)
|
284
|
-
- name: resp_code_INUSE_rfc9051_7.1_example
|
285
|
-
prelude: |2
|
286
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
287
|
-
"test_resp_code_INUSE_rfc9051_7.1_example")
|
288
|
-
script: parser.parse(response)
|
289
|
-
- name: resp_code_LIMIT_rfc9051_7.1_example
|
290
|
-
prelude: |2
|
291
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
292
|
-
"test_resp_code_LIMIT_rfc9051_7.1_example")
|
293
|
-
script: parser.parse(response)
|
294
|
-
- name: resp_code_NONEXISTENT_rfc9051_7.1_example
|
295
|
-
prelude: |2
|
296
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
297
|
-
"test_resp_code_NONEXISTENT_rfc9051_7.1_example")
|
298
|
-
script: parser.parse(response)
|
299
|
-
- name: resp_code_NOPERM_rfc9051_7.1_example
|
300
|
-
prelude: |2
|
301
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
302
|
-
"test_resp_code_NOPERM_rfc9051_7.1_example")
|
303
|
-
script: parser.parse(response)
|
304
|
-
- name: resp_code_OVERQUOTA_rfc9051_7.1_example_1
|
305
|
-
prelude: |2
|
306
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
307
|
-
"test_resp_code_OVERQUOTA_rfc9051_7.1_example_1")
|
308
|
-
script: parser.parse(response)
|
309
|
-
- name: resp_code_OVERQUOTA_rfc9051_7.1_example_2
|
310
|
-
prelude: |2
|
311
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
312
|
-
"test_resp_code_OVERQUOTA_rfc9051_7.1_example_2")
|
313
|
-
script: parser.parse(response)
|
314
|
-
- name: resp_code_PERMANENTFLAGS_rfc3501_6.3.1_example
|
315
|
-
prelude: |2
|
316
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
317
|
-
"test_resp_code_PERMANENTFLAGS_rfc3501_6.3.1_example")
|
318
|
-
script: parser.parse(response)
|
319
|
-
- name: resp_code_PERMANENTFLAGS_rfc3501_6.3.2_example
|
320
|
-
prelude: |2
|
321
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
322
|
-
"test_resp_code_PERMANENTFLAGS_rfc3501_6.3.2_example")
|
323
|
-
script: parser.parse(response)
|
324
|
-
- name: resp_code_PRIVACYREQUIRED_rfc9051_7.1_example
|
325
|
-
prelude: |2
|
326
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
327
|
-
"test_resp_code_PRIVACYREQUIRED_rfc9051_7.1_example")
|
328
|
-
script: parser.parse(response)
|
329
|
-
- name: resp_code_READ-ONLY_rfc3501_6.3.2_example
|
330
|
-
prelude: |2
|
331
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
332
|
-
"test_resp_code_READ-ONLY_rfc3501_6.3.2_example")
|
333
|
-
script: parser.parse(response)
|
334
|
-
- name: resp_code_READ-WRITE_rfc3501_6.3.1_example
|
335
|
-
prelude: |2
|
336
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
337
|
-
"test_resp_code_READ-WRITE_rfc3501_6.3.1_example")
|
338
|
-
script: parser.parse(response)
|
339
|
-
- name: resp_code_SERVERBUG_rfc9051_7.1_example
|
340
|
-
prelude: |2
|
341
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
342
|
-
"test_resp_code_SERVERBUG_rfc9051_7.1_example")
|
343
|
-
script: parser.parse(response)
|
344
|
-
- name: resp_code_UIDNEXT_rfc3501_6.3.1_example
|
345
|
-
prelude: |2
|
346
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
347
|
-
"test_resp_code_UIDNEXT_rfc3501_6.3.1_example")
|
348
|
-
script: parser.parse(response)
|
349
|
-
- name: resp_code_UIDVALIDITY_rfc3501_6.3.1_example
|
350
|
-
prelude: |2
|
351
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
352
|
-
"test_resp_code_UIDVALIDITY_rfc3501_6.3.1_example")
|
353
|
-
script: parser.parse(response)
|
354
|
-
- name: resp_code_UNAVAILABLE_rfc9051_7.1_example
|
355
|
-
prelude: |2
|
356
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
357
|
-
"test_resp_code_UNAVAILABLE_rfc9051_7.1_example")
|
358
|
-
script: parser.parse(response)
|
359
|
-
- name: resp_code_UNSEEN_rfc3501_6.3.1_example
|
360
|
-
prelude: |2
|
361
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_code_examples.yml",
|
362
|
-
"test_resp_code_UNSEEN_rfc3501_6.3.1_example")
|
363
|
-
script: parser.parse(response)
|
364
|
-
- name: resp_text_with_T_LBRA
|
365
|
-
prelude: |2
|
366
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_text_responses.yml",
|
367
|
-
"test_resp_text_with_T_LBRA")
|
368
|
-
script: parser.parse(response)
|
369
|
-
- name: rfc3501_6.1.1_example_1_capability_response
|
370
|
-
prelude: |2
|
371
|
-
response = load_response("../test/net/imap/fixtures/response_parser/capability_responses.yml",
|
372
|
-
"rfc3501_6.1.1_example_1_capability_response")
|
373
|
-
script: parser.parse(response)
|
374
|
-
- name: rfc3501_6.1.1_example_2_capability_response
|
375
|
-
prelude: |2
|
376
|
-
response = load_response("../test/net/imap/fixtures/response_parser/capability_responses.yml",
|
377
|
-
"rfc3501_6.1.1_example_2_capability_response")
|
378
|
-
script: parser.parse(response)
|
379
|
-
- name: rfc3501_6.2.2_example_continuation_request
|
380
|
-
prelude: |2
|
381
|
-
response = load_response("../test/net/imap/fixtures/response_parser/continuation_requests.yml",
|
382
|
-
"rfc3501_6.2.2_example_continuation_request")
|
383
|
-
script: parser.parse(response)
|
384
|
-
- name: rfc3501_6.3.11_example_continuation_request
|
385
|
-
prelude: |2
|
386
|
-
response = load_response("../test/net/imap/fixtures/response_parser/continuation_requests.yml",
|
387
|
-
"rfc3501_6.3.11_example_continuation_request")
|
388
|
-
script: parser.parse(response)
|
389
|
-
- name: rfc3501_7.1.1_OK_response_example_1
|
390
|
-
prelude: |2
|
391
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_cond_examples.yml",
|
392
|
-
"rfc3501_7.1.1_OK_response_example_1")
|
393
|
-
script: parser.parse(response)
|
394
|
-
- name: rfc3501_7.1.1_OK_response_example_2
|
395
|
-
prelude: |2
|
396
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_cond_examples.yml",
|
397
|
-
"rfc3501_7.1.1_OK_response_example_2")
|
398
|
-
script: parser.parse(response)
|
399
|
-
- name: rfc3501_7.1.1_OK_response_example_3
|
400
|
-
prelude: |2
|
401
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_cond_examples.yml",
|
402
|
-
"rfc3501_7.1.1_OK_response_example_3")
|
403
|
-
script: parser.parse(response)
|
404
|
-
- name: rfc3501_7.1.2_NO_response_example_1
|
405
|
-
prelude: |2
|
406
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_cond_examples.yml",
|
407
|
-
"rfc3501_7.1.2_NO_response_example_1")
|
408
|
-
script: parser.parse(response)
|
409
|
-
- name: rfc3501_7.1.2_NO_response_example_4
|
410
|
-
prelude: |2
|
411
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_cond_examples.yml",
|
412
|
-
"rfc3501_7.1.2_NO_response_example_4")
|
413
|
-
script: parser.parse(response)
|
414
|
-
- name: rfc3501_7.1.3_BAD_response_example
|
415
|
-
prelude: |2
|
416
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_cond_examples.yml",
|
417
|
-
"rfc3501_7.1.3_BAD_response_example")
|
418
|
-
script: parser.parse(response)
|
419
|
-
- name: rfc3501_7.1.4_PREAUTH_response_example
|
420
|
-
prelude: |2
|
421
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_cond_examples.yml",
|
422
|
-
"rfc3501_7.1.4_PREAUTH_response_example")
|
423
|
-
script: parser.parse(response)
|
424
|
-
- name: rfc3501_7.1.5_BYE_response_example
|
425
|
-
prelude: |2
|
426
|
-
response = load_response("../test/net/imap/fixtures/response_parser/resp_cond_examples.yml",
|
427
|
-
"rfc3501_7.1.5_BYE_response_example")
|
428
|
-
script: parser.parse(response)
|
429
|
-
- name: rfc3501_7.2.1_CAPABILITY_response_example
|
430
|
-
prelude: |2
|
431
|
-
response = load_response("../test/net/imap/fixtures/response_parser/capability_responses.yml",
|
432
|
-
"rfc3501_7.2.1_CAPABILITY_response_example")
|
433
|
-
script: parser.parse(response)
|
434
|
-
- name: rfc3501_7.2.2_LIST_response_example
|
435
|
-
prelude: |2
|
436
|
-
response = load_response("../test/net/imap/fixtures/response_parser/list_responses.yml",
|
437
|
-
"rfc3501_7.2.2_LIST_response_example")
|
438
|
-
script: parser.parse(response)
|
439
|
-
- name: rfc3501_7.2.3_LSUB_response_example
|
440
|
-
prelude: |2
|
441
|
-
response = load_response("../test/net/imap/fixtures/response_parser/list_responses.yml",
|
442
|
-
"rfc3501_7.2.3_LSUB_response_example")
|
443
|
-
script: parser.parse(response)
|
444
|
-
- name: rfc3501_7.2.4_STATUS_response_example
|
445
|
-
prelude: |2
|
446
|
-
response = load_response("../test/net/imap/fixtures/response_parser/status_responses.yml",
|
447
|
-
"rfc3501_7.2.4_STATUS_response_example")
|
448
|
-
script: parser.parse(response)
|
449
|
-
- name: rfc3501_7.2.5_SEARCH_response_example
|
450
|
-
prelude: |2
|
451
|
-
response = load_response("../test/net/imap/fixtures/response_parser/search_responses.yml",
|
452
|
-
"rfc3501_7.2.5_SEARCH_response_example")
|
453
|
-
script: parser.parse(response)
|
454
|
-
- name: rfc3501_7.2.6_FLAGS_response_example
|
455
|
-
prelude: |2
|
456
|
-
response = load_response("../test/net/imap/fixtures/response_parser/flags_responses.yml",
|
457
|
-
"rfc3501_7.2.6_FLAGS_response_example")
|
458
|
-
script: parser.parse(response)
|
459
|
-
- name: rfc3501_7.3.1_EXISTS_response_example
|
460
|
-
prelude: |2
|
461
|
-
response = load_response("../test/net/imap/fixtures/response_parser/mailbox_size_responses.yml",
|
462
|
-
"rfc3501_7.3.1_EXISTS_response_example")
|
463
|
-
script: parser.parse(response)
|
464
|
-
- name: rfc3501_7.3.2_RECENT_response_example
|
465
|
-
prelude: |2
|
466
|
-
response = load_response("../test/net/imap/fixtures/response_parser/mailbox_size_responses.yml",
|
467
|
-
"rfc3501_7.3.2_RECENT_response_example")
|
468
|
-
script: parser.parse(response)
|
469
|
-
- name: rfc3501_7.4.1_EXPUNGE_response_example
|
470
|
-
prelude: |2
|
471
|
-
response = load_response("../test/net/imap/fixtures/response_parser/expunge_responses.yml",
|
472
|
-
"rfc3501_7.4.1_EXPUNGE_response_example")
|
473
|
-
script: parser.parse(response)
|
474
|
-
- name: rfc3501_7.4.2_FETCH_response_example
|
475
|
-
prelude: |2
|
476
|
-
response = load_response("../test/net/imap/fixtures/response_parser/fetch_responses.yml",
|
477
|
-
"rfc3501_7.4.2_FETCH_response_example")
|
478
|
-
script: parser.parse(response)
|
479
|
-
- name: rfc3501_7.5_continuation_request_example
|
480
|
-
prelude: |2
|
481
|
-
response = load_response("../test/net/imap/fixtures/response_parser/continuation_requests.yml",
|
482
|
-
"rfc3501_7.5_continuation_request_example")
|
483
|
-
script: parser.parse(response)
|
484
|
-
- name: rfc3501_8_example_1_UNSEEN_response_code
|
485
|
-
prelude: |2
|
486
|
-
response = load_response("../test/net/imap/fixtures/response_parser/rfc3501_examples.yml",
|
487
|
-
"rfc3501_8_example_1_UNSEEN_response_code")
|
488
|
-
script: parser.parse(response)
|
489
|
-
- name: rfc3501_8_example_2_UIDVALIDITY_response_code
|
490
|
-
prelude: |2
|
491
|
-
response = load_response("../test/net/imap/fixtures/response_parser/rfc3501_examples.yml",
|
492
|
-
"rfc3501_8_example_2_UIDVALIDITY_response_code")
|
493
|
-
script: parser.parse(response)
|
494
|
-
- name: rfc3501_8_example_3_FETCH_ENVELOPE
|
495
|
-
prelude: |2
|
496
|
-
response = load_response("../test/net/imap/fixtures/response_parser/rfc3501_examples.yml",
|
497
|
-
"rfc3501_8_example_3_FETCH_ENVELOPE")
|
498
|
-
script: parser.parse(response)
|
499
|
-
- name: rfc3501_8_example_4_FETCH_BODY[HEADER]
|
500
|
-
prelude: |2
|
501
|
-
response = load_response("../test/net/imap/fixtures/response_parser/rfc3501_examples.yml",
|
502
|
-
"rfc3501_8_example_4_FETCH_BODY[HEADER]")
|
503
|
-
script: parser.parse(response)
|
504
|
-
- name: rfc9051_7.2.1_ENABLED_example
|
505
|
-
prelude: |2
|
506
|
-
response = load_response("../test/net/imap/fixtures/response_parser/enabled_responses.yml",
|
507
|
-
"rfc9051_7.2.1_ENABLED_example")
|
508
|
-
script: parser.parse(response)
|
509
|
-
- name: rfc9051_7.2.2_capability_example
|
510
|
-
prelude: |2
|
511
|
-
response = load_response("../test/net/imap/fixtures/response_parser/capability_responses.yml",
|
512
|
-
"rfc9051_7.2.2_capability_example")
|
513
|
-
script: parser.parse(response)
|
514
|
-
- name: search_response_empty
|
515
|
-
prelude: |2
|
516
|
-
response = load_response("../test/net/imap/fixtures/response_parser/search_responses.yml",
|
517
|
-
"test_search_response_empty")
|
518
|
-
script: parser.parse(response)
|
519
|
-
- name: search_response_multiple_seq_nums_returned
|
520
|
-
prelude: |2
|
521
|
-
response = load_response("../test/net/imap/fixtures/response_parser/search_responses.yml",
|
522
|
-
"test_search_response_multiple_seq_nums_returned")
|
523
|
-
script: parser.parse(response)
|
524
|
-
- name: search_response_single_seq_nums_returned
|
525
|
-
prelude: |2
|
526
|
-
response = load_response("../test/net/imap/fixtures/response_parser/search_responses.yml",
|
527
|
-
"test_search_response_single_seq_nums_returned")
|
528
|
-
script: parser.parse(response)
|
529
|
-
- name: search_response_with_condstore_modseq
|
530
|
-
prelude: |2
|
531
|
-
response = load_response("../test/net/imap/fixtures/response_parser/search_responses.yml",
|
532
|
-
"test_search_response_with_condstore_modseq")
|
533
|
-
script: parser.parse(response)
|
534
|
-
- name: status_response_uidnext_uidvalidity
|
535
|
-
prelude: |2
|
536
|
-
response = load_response("../test/net/imap/fixtures/response_parser/status_responses.yml",
|
537
|
-
"test_status_response_uidnext_uidvalidity")
|
538
|
-
script: parser.parse(response)
|
539
|
-
- name: thread_rfc5256_example1
|
540
|
-
prelude: |2
|
541
|
-
response = load_response("../test/net/imap/fixtures/response_parser/thread_responses.yml",
|
542
|
-
"thread_rfc5256_example1")
|
543
|
-
script: parser.parse(response)
|
544
|
-
- name: thread_rfc5256_example2
|
545
|
-
prelude: |2
|
546
|
-
response = load_response("../test/net/imap/fixtures/response_parser/thread_responses.yml",
|
547
|
-
"thread_rfc5256_example2")
|
548
|
-
script: parser.parse(response)
|
549
|
-
- name: thread_rfc5256_example3
|
550
|
-
prelude: |2
|
551
|
-
response = load_response("../test/net/imap/fixtures/response_parser/thread_responses.yml",
|
552
|
-
"thread_rfc5256_example3")
|
553
|
-
script: parser.parse(response)
|
554
|
-
- name: thread_rfc5256_example4
|
555
|
-
prelude: |2
|
556
|
-
response = load_response("../test/net/imap/fixtures/response_parser/thread_responses.yml",
|
557
|
-
"thread_rfc5256_example4")
|
558
|
-
script: parser.parse(response)
|
559
|
-
- name: thread_rfc5256_example5
|
560
|
-
prelude: |2
|
561
|
-
response = load_response("../test/net/imap/fixtures/response_parser/thread_responses.yml",
|
562
|
-
"thread_rfc5256_example5")
|
563
|
-
script: parser.parse(response)
|
564
|
-
- name: utf8_in_list_mailbox
|
565
|
-
prelude: |2
|
566
|
-
response = load_response("../test/net/imap/fixtures/response_parser/utf8_responses.yml",
|
567
|
-
"test_utf8_in_list_mailbox")
|
568
|
-
script: parser.parse(response)
|
569
|
-
- name: utf8_in_resp_text
|
570
|
-
prelude: |2
|
571
|
-
response = load_response("../test/net/imap/fixtures/response_parser/utf8_responses.yml",
|
572
|
-
"test_utf8_in_resp_text")
|
573
|
-
script: parser.parse(response)
|
574
|
-
- name: xlist_inbox
|
575
|
-
prelude: |2
|
576
|
-
response = load_response("../test/net/imap/fixtures/response_parser/list_responses.yml",
|
577
|
-
"test_xlist_inbox")
|
578
|
-
script: parser.parse(response)
|
data/benchmarks/stringprep.yml
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
---
|
2
|
-
prelude: |
|
3
|
-
begin
|
4
|
-
require "mongo" # gem install mongo
|
5
|
-
require "idn" # gem install idn-ruby
|
6
|
-
rescue LoadError
|
7
|
-
warn "You must 'gem install mongo idn-ruby' for this benchmark."
|
8
|
-
raise
|
9
|
-
end
|
10
|
-
|
11
|
-
MStrPrep = Mongo::Auth::StringPrep
|
12
|
-
|
13
|
-
# this indirection will slow it down a little bit
|
14
|
-
def mongo_saslprep(string)
|
15
|
-
MStrPrep.prepare(string,
|
16
|
-
MStrPrep::Profiles::SASL::MAPPINGS,
|
17
|
-
MStrPrep::Profiles::SASL::PROHIBITED,
|
18
|
-
normalize: true,
|
19
|
-
bidi: true)
|
20
|
-
rescue Mongo::Error::FailedStringPrepValidation
|
21
|
-
nil
|
22
|
-
end
|
23
|
-
|
24
|
-
$LOAD_PATH.unshift "./lib"
|
25
|
-
require "net/imap"
|
26
|
-
def net_imap_saslprep(string)
|
27
|
-
Net::IMAP::StringPrep::SASLprep.saslprep string, exception: false
|
28
|
-
end
|
29
|
-
|
30
|
-
def libidn_saslprep(string)
|
31
|
-
IDN::Stringprep.with_profile(string, "SASLprep")
|
32
|
-
rescue IDN::Stringprep::StringprepError
|
33
|
-
nil
|
34
|
-
end
|
35
|
-
|
36
|
-
benchmark:
|
37
|
-
- net_imap_saslprep "I\u00ADX" # RFC example 1. IX
|
38
|
-
- net_imap_saslprep "user" # RFC example 2. user
|
39
|
-
- net_imap_saslprep "USER" # RFC example 3. user
|
40
|
-
- net_imap_saslprep "\u00aa" # RFC example 4. a
|
41
|
-
- net_imap_saslprep "\u2168" # RFC example 5. IX
|
42
|
-
- net_imap_saslprep "\u0007" # RFC example 6. Error - prohibited character
|
43
|
-
- net_imap_saslprep "\u0627\u0031" # RFC example 7. Error - bidirectional check
|
44
|
-
- net_imap_saslprep "I\u2000X" # map to space: I X
|
45
|
-
- net_imap_saslprep "a longer string, e.g. a password"
|
46
|
-
|
47
|
-
- libidn_saslprep "I\u00ADX" # RFC example 1. IX
|
48
|
-
- libidn_saslprep "user" # RFC example 2. user
|
49
|
-
- libidn_saslprep "USER" # RFC example 3. user
|
50
|
-
- libidn_saslprep "\u00aa" # RFC example 4. a
|
51
|
-
- libidn_saslprep "\u2168" # RFC example 5. IX
|
52
|
-
- libidn_saslprep "\u0007" # RFC example 6. Error - prohibited character
|
53
|
-
- libidn_saslprep "\u0627\u0031" # RFC example 7. Error - bidirectional check
|
54
|
-
- libidn_saslprep "I\u2000X" # map to space: I X
|
55
|
-
- libidn_saslprep "a longer string, e.g. a password"
|
56
|
-
|
57
|
-
- mongo_saslprep "I\u00ADX" # RFC example 1. IX
|
58
|
-
- mongo_saslprep "user" # RFC example 2. user
|
59
|
-
- mongo_saslprep "USER" # RFC example 3. user
|
60
|
-
- mongo_saslprep "\u00aa" # RFC example 4. a
|
61
|
-
- mongo_saslprep "\u2168" # RFC example 5. IX
|
62
|
-
- mongo_saslprep "\u0007" # RFC example 6. Error - prohibited character
|
63
|
-
- mongo_saslprep "\u0627\u0031" # RFC example 7. Error - bidirectional check
|
64
|
-
- mongo_saslprep "I\u2000X" # map to space: I X
|
65
|
-
- mongo_saslprep "a longer string, e.g. a password"
|