-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_test.go
403 lines (399 loc) · 17.9 KB
/
generate_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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
package gowpcli
import (
"testing"
)
func forkv(t *testing.T, f func(k, v string) error) {
for k, v := range TESTS {
if err := f(k, v); err != nil {
t.Error(err)
}
}
}
var TESTS = map[string]string{
"[--post_types=<post-types>]": "[--post_types=<post-types>]",
"[--format=<format>]": "[--format=<format>]",
"<db-id>": "<db-id>",
"<user-email>": "<user-email>",
"--admin_user=<username>": "--admin_user=<username>",
"[<command>...]": "[<command>...]",
"[--headers=<headers>]": "[--headers=<headers>]",
"[<next-run>]": "[<next-run>]",
"[--skip-tests]": "[--skip-tests]",
"[--order=<order>]": "[--order=<order>]",
"[--patch]": "[--patch]",
"[--post_type=<type>]": "[--post_type=<type>]",
"[--post_author=<login>]": "[--post_author=<login>]",
"[<tables>...]": "[<tables>...]",
"[--comment_status=<comment_status>]": "[--comment_status=<comment_status>]",
"[--plugin_author=<author>]": "[--plugin_author=<author>]",
"[--raw]": "[--raw]",
"[--dbcharset=<dbcharset>]": "[--dbcharset=<dbcharset>]",
"<mod>": "<mod>",
"[--discover]": "[--discover]",
"[<token>]": "[<token>]",
"[--tag-base=<base>]": "[--tag-base=<base>]",
"<menu-name>": "<menu-name>",
"<name|git|path|zip>": "<name|git|path|zip>",
"[--match_color=<color_code>]": "[--match_color=<color_code>]",
"[--nickname=<nickname>]": "[--nickname=<nickname>]",
"[--to_ping=<to_ping>]": "[--to_ping=<to_ping>]",
"[--post_author=<post_author>]": "[--post_author=<post_author>]",
"<menu>...": "<menu>...",
"[--host=<host>]": "[--host=<host>]",
"<plugin|zip|url>...": "<plugin|zip|url>...",
"[--height=<height>]": "[--height=<height>]",
"[--dbprefix=<dbprefix>]": "[--dbprefix=<dbprefix>]",
"<language>...": "<language>...",
"[<file>]": "[<file>]",
"[--subdomains]": "[--subdomains]",
"[--minor]": "[--minor]",
"[--post_status=<status>]": "[--post_status=<status>]",
"[--post_modified_gmt=<post_modified_gmt>]": "[--post_modified_gmt=<post_modified_gmt>]",
"[--edit]": "[--edit]",
"[--verbose]": "[--verbose]",
"<user>": "<user>",
"[--stdout]": "[--stdout]",
"[--image_size=<image_size>]": "[--image_size=<image_size>]",
"[--scope=<scope>]": "[--scope=<scope>]",
"[--base=<url-path>]": "[--base=<url-path>]",
"[<attachment-id>...]": "[<attachment-id>...]",
"[--only-missing]": "[--only-missing]",
"<url>": "<url>",
"[--page=<page>]": "[--page=<page>]",
"[--parent=<term-id>]": "[--parent=<term-id>]",
"[--dry-run]": "[--dry-run]",
"[<theme>]": "[<theme>]",
"[--classes=<classes>]": "[--classes=<classes>]",
"[--ci=<provider>]": "[--ci=<provider>]",
"[<arg>...]": "[<arg>...]",
"[<role>]": "[<role>]",
"[--category=<category>]": "[--category=<category>]",
"[--due-now]": "[--due-now]",
"[--skip-audit]": "[--skip-audit]",
"<role>": "<role>",
"[--slug=<slug>]": "[--slug=<slug>]",
"<permastruct>": "<permastruct>",
"[--post_type=<post_type>]": "[--post_type=<post_type>]",
"<term>": "<term>",
"[--name=<name>]": "[--name=<name>]",
"[--ping_status=<ping_status>]": "[--ping_status=<ping_status>]",
"[--expired]": "[--expired]",
"[--merge[=<paths>]]": "[--merge[=<paths>]]",
"--line=<line>": "--line=<line>",
"[--post-id=<id>]": "[--post-id=<id>]",
"[--regex]": "[--regex]",
"[--purge]": "[--purge]",
"[--post_name=<post_name>]": "[--post_name=<post_name>]",
"[--tags_input=<tags_input>]": "[--tags_input=<tags_input>]",
"<php-code>": "<php-code>",
"[--post_date_gmt=<yyyy-mm-dd-hh-ii-ss>]": "[--post_date_gmt=<yyyy-mm-dd-hh-ii-ss>]",
"[--add]": "[--add]",
"[<hook>...]": "[<hook>...]",
"[--recurse-objects]": "[--recurse-objects]",
"[--start_id=<pid>]": "[--start_id=<pid>]",
"[--alt=<alt_text>]": "[--alt=<alt_text>]",
"<post_id>": "<post_id>",
"[--skip-columns=<columns>]": "[--skip-columns=<columns>]",
"[--post_id=<post-id>]": "[--post_id=<post-id>]",
"[--activate]": "[--activate]",
"<sidebar-id>": "<sidebar-id>",
"[--featured_image]": "[--featured_image]",
"<user-login>": "<user-login>",
"--slug=<slug>": "--slug=<slug>",
"<id>": "<id>",
"[--force-regex]": "[--force-regex]",
"[--author_uri=<uri>]": "[--author_uri=<uri>]",
"[--file-comment=<file-comment>]": "[--file-comment=<file-comment>]",
"[--network]": "[--network]",
"[--first_name=<first_name>]": "[--first_name=<first_name>]",
"[--anchor=<anchor>]": "[--anchor=<anchor>]",
"<command_name>...": "<command_name>...",
"[--table_column_color=<color_code>]": "[--table_column_color=<color_code>]",
"[--post_date=<yyyy-mm-dd-hh-ii-ss>]": "[--post_date=<yyyy-mm-dd-hh-ii-ss>]",
"[--author=<author>]": "[--author=<author>]",
"[--report-changed-only]": "[--report-changed-only]",
"[--post_id=<post_id>]": "[--post_id=<post_id>]",
"[--ignore-domain]": "[--ignore-domain]",
"[--skip-salts]": "[--skip-salts]",
"[--do-shortcode]": "[--do-shortcode]",
"<new>": "<new>",
"<role-key>": "<role-key>",
"[--regex-delimiter=<regex-delimiter>]": "[--regex-delimiter=<regex-delimiter>]",
"[--plugin=<plugin>]": "[--plugin=<plugin>]",
"[--unserialize]": "[--unserialize]",
"[--user_email=<email>]": "[--user_email=<email>]",
"[--theme]": "[--theme]",
"[--skip-tables=<tables>]": "[--skip-tables=<tables>]",
"[--table_column_once]": "[--table_column_once]",
"[--author=<full-name>]": "[--author=<full-name>]",
"[--defer-term-counting]": "[--defer-term-counting]",
"--admin_email=<email>": "--admin_email=<email>",
"<key-path>...": "<key-path>...",
"[--nightly]": "[--nightly]",
"<plugin>": "<plugin>",
"[--role=<role>]": "[--role=<role>]",
"<theme|zip|url>...": "<theme|zip|url>...",
"[--theme_name=<title>]": "[--theme_name=<title>]",
"--parent_theme=<slug>": "--parent_theme=<slug>",
"[--field=<field>]": "[--field=<field>]",
"[--<field>=<value>]": "[--<field>=<value>]",
"<db-id>...": "<db-id>...",
"[--user_nicename=<nice_name>]": "[--user_nicename=<nice_name>]",
"[--skip-sanitization]": "[--skip-sanitization]",
"--point=<point>": "--point=<point>",
"<widget-id>...": "<widget-id>...",
"[--yes]": "[--yes]",
"<link>": "<link>",
"[--version=<version>]": "[--version=<version>]",
"[--match=<url>]": "[--match=<url>]",
"[--human-readable]": "[--human-readable]",
"[--subtract=<paths>]": "[--subtract=<paths>]",
"[--skip-copy]": "[--skip-copy]",
"<location>": "<location>",
"[--post_type=<post-type>]": "[--post_type=<post-type>]",
"[--dbcollate=<dbcollate>]": "[--dbcollate=<dbcollate>]",
"[<post-id>]": "[<post-id>]",
"[--post_mime_type=<post_mime_type>]": "[--post_mime_type=<post_mime_type>]",
"[--major]": "[--major]",
"[--menu_order=<menu_order>]": "[--menu_order=<menu_order>]",
"[--by=<field>]": "[--by=<field>]",
"[--dbpass=<value>]": "[--dbpass=<value>]",
"[--placement=<placement>]": "[--placement=<placement>]",
"[--target=<target>]": "[--target=<target>]",
"[--post_password=<post_password>]": "[--post_password=<post_password>]",
"[--dashicon=<dashicon>]": "[--dashicon=<dashicon>]",
"[--skip-update]": "[--skip-update]",
"[--category=<name>]": "[--category=<name>]",
"[--skip-cache]": "[--skip-cache]",
"<cap>...": "<cap>...",
"[--caption=<caption>]": "[--caption=<caption>]",
"[--hard]": "[--hard]",
"[<download-url>]": "[<download-url>]",
"[--all-tables]": "[--all-tables]",
"[--per-page=<per-page>]": "[--per-page=<per-page>]",
"[--regex-limit=<regex-limit>]": "[--regex-limit=<regex-limit>]",
"[<term>...]": "[<term>...]",
"[--set-ssh=<ssh>]": "[--set-ssh=<ssh>]",
"<role-name>": "<role-name>",
"[--exclude=<theme-names>]": "[--exclude=<theme-names>]",
"[--description=<description>]": "[--description=<description>]",
"[--pinged=<pinged>]": "[--pinged=<pinged>]",
"[--site__in=<value>]": "[--site__in=<value>]",
"[--post_content]": "[--post_content]",
"[--admin_password=<password>]": "[--admin_password=<password>]",
"[--transients]": "[--transients]",
"[--skip-email]": "[--skip-email]",
"[<mod>...]": "[<mod>...]",
"[--user_url=<url>]": "[--user_url=<url>]",
"[--enable-network]": "[--enable-network]",
"[--uploads]": "[--uploads]",
"[--from=<taxonomy>]": "[--from=<taxonomy>]",
"[--package-name=<name>]": "[--package-name=<name>]",
"[--all-tables-with-prefix]": "[--all-tables-with-prefix]",
"[--skip-check]": "[--skip-check]",
"[--user_pass=<password>]": "[--user_pass=<password>]",
"<id>...": "<id>...",
"[--sassify]": "[--sassify]",
"[--post_modified=<post_modified>]": "[--post_modified=<post_modified>]",
"[<sql>]": "[<sql>]",
"[--matches_only]": "[--matches_only]",
"[--to=<taxonomy>]": "[--to=<taxonomy>]",
"[<group>]": "[<group>]",
"[--width=<width>]": "[--width=<width>]",
"<key>": "<key>",
"[--force]": "[--force]",
"<term>...": "<term>...",
"<user_pass>": "<user_pass>",
"[--title=<network-title>]": "[--title=<network-title>]",
"[--filename_format=<format>]": "[--filename_format=<format>]",
"[--display_name=<display_name>]": "[--display_name=<display_name>]",
"[--raw-format=<json|xml>]": "[--raw-format=<json|xml>]",
"[--autoload=<value>]": "[--autoload=<value>]",
"[--dbuser=<value>]": "[--dbuser=<value>]",
"[<filter>...]": "[<filter>...]",
"<theme>": "<theme>",
"[<position>]": "[<position>]",
"[--private]": "[--private]",
"[--export_insert_size=<rows>]": "[--export_insert_size=<rows>]",
"[<table>]": "[<table>]",
"[--post_excerpt=<post_excerpt>]": "[--post_excerpt=<post_excerpt>]",
"[--report]": "[--report]",
"[--with-values]": "[--with-values]",
"[--dbpass=<dbpass>]": "[--dbpass=<dbpass>]",
"[--tax_input=<tax_input>]": "[--tax_input=<tax_input>]",
"[--exclude=<paths>]": "[--exclude=<paths>]",
"[--max_num_posts=<num>]": "[--max_num_posts=<num>]",
"[--domain=<domain>]": "[--domain=<domain>]",
"[--limit-response-size=<size>]": "[--limit-response-size=<size>]",
"<source>": "<source>",
"<name>": "<name>",
"[--end_date=<date>]": "[--end_date=<date>]",
"[<key>]": "[<key>]",
"[--woocommerce]": "[--woocommerce]",
"[--network=<id>]": "[--network=<id>]",
"<language>": "<language>",
"[--path=<path>]": "[--path=<path>]",
"[--post__in=<pid>]": "[--post__in=<pid>]",
"[--dir]": "[--dir]",
"[--plugin_author_uri=<url>]": "[--plugin_author_uri=<url>]",
"[--show-grant]": "[--show-grant]",
"[--deactivate]": "[--deactivate]",
"[--search=<pattern>]": "[--search=<pattern>]",
"[--database=<database>]": "[--database=<database>]",
"[--email=<email>]": "[--email=<email>]",
"[--plugin_uri=<url>]": "[--plugin_uri=<url>]",
"[<recurrence>]": "[<recurrence>]",
"[--position=<position>]": "[--position=<position>]",
"[--locale=<locale>]": "[--locale=<locale>]",
"--url=<url>": "--url=<url>",
"[--uninstall]": "[--uninstall]",
"<post-type>": "<post-type>",
"[<sidebar-id>...]": "[<sidebar-id>...]",
"[--strict]": "[--strict]",
"[--textdomain=<textdomain>]": "[--textdomain=<textdomain>]",
"[--post_parent=<post_parent>]": "[--post_parent=<post_parent>]",
"[--with_attachments]": "[--with_attachments]",
"[--pretty-print]": "[--pretty-print]",
"<file>...": "<file>...",
"[--skip-delete]": "[--skip-delete]",
"[<name>]": "[<name>]",
"--title=<site-title>": "--title=<site-title>",
"[--post_type__not_in=<post-type>]": "[--post_type__not_in=<post-type>]",
"<taxonomy>...": "<taxonomy>...",
"<key>...": "<key>...",
"[--keep-tables]": "[--keep-tables]",
"[--stable]": "[--stable]",
"[--plugin_name=<title>]": "[--plugin_name=<title>]",
"[--send-email]": "[--send-email]",
"[--post_content_filtered=<post_content_filtered>]": "[--post_content_filtered=<post_content_filtered>]",
"<widget-id>": "<widget-id>",
"[--config=<file>]": "[--config=<file>]",
"[--preserve-filetime]": "[--preserve-filetime]",
"[--desc=<description>]": "[--desc=<description>]",
"[--skip=<data-type>]": "[--skip=<data-type>]",
"[--format]": "[--format]",
"[--source=<source>]": "[--source=<source>]",
"<user>...": "<user>...",
"[--porcelain]": "[--porcelain]",
"[<plugin>...]": "[<plugin>...]",
"--authors=<authors>": "--authors=<authors>",
"[--separator=<separator>]": "[--separator=<separator>]",
"[--guid=<guid>]": "[--guid=<guid>]",
"<slug>": "<slug>",
"<search>": "<search>",
"[--skip_comments]": "[--skip_comments]",
"[--set-url=<url>]": "[--set-url=<url>]",
"[--from-post=<post_id>]": "[--from-post=<post_id>]",
"--<field>=<value>": "--<field>=<value>",
"<menu>": "<menu>",
"[--post_date=<post_date>]": "[--post_date=<post_date>]",
"[--one_line]": "[--one_line]",
"--dbuser=<dbuser>": "--dbuser=<dbuser>",
"[--link-type=<json|xml>]": "[--link-type=<json|xml>]",
"[--meta_input=<meta_input>]": "[--meta_input=<meta_input>]",
"[<role-key>...]": "[<role-key>...]",
"[--log[=<file>]]": "[--log[=<file>]]",
"[<theme>...]": "[<theme>...]",
"[--post_title=<post_title>]": "[--post_title=<post_title>]",
"[--post_category=<post_category>]": "[--post_category=<post_category>]",
"[--theme_uri=<uri>]": "[--theme_uri=<uri>]",
"[--skip-wordpress]": "[--skip-wordpress]",
"[--skip-config]": "[--skip-config]",
"[--extra]": "[--extra]",
"<value>": "<value>",
"[--url=<url>]": "[--url=<url>]",
"[--size_format=<format>]": "[--size_format=<format>]",
"[--default-character-set=<character-set>]": "[--default-character-set=<character-set>]",
"[--fields=<fields>]": "[--fields=<fields>]",
"[--all]": "[--all]",
"[--skip-js]": "[--skip-js]",
"<post-id>": "<post-id>",
"[<site-id>]": "[<site-id>]",
"[<value>]": "[<value>]",
"[--set-user=<user>]": "[--set-user=<user>]",
"[--precise]": "[--precise]",
"[--parent-id=<parent-id>]": "[--parent-id=<parent-id>]",
"[--regex-flags=<regex-flags>]": "[--regex-flags=<regex-flags>]",
"[--keys=<keys>]": "[--keys=<keys>]",
"[--dir=<dirname>]": "[--dir=<dirname>]",
"[<offset>]": "[<offset>]",
"[--after_context=<num>]": "[--after_context=<num>]",
"[--include-columns=<columns>]": "[--include-columns=<columns>]",
"[--grouping=<grouping>]": "[--grouping=<grouping>]",
"[--category-base=<base>]": "[--category-base=<base>]",
"[--display_name=<name>]": "[--display_name=<name>]",
"[--set-path=<path>]": "[--set-path=<path>]",
"[--exclude_tables=<tables>]": "[--exclude_tables=<tables>]",
"[--user_registered=<yyyy-mm-dd-hh-ii-ss>]": "[--user_registered=<yyyy-mm-dd-hh-ii-ss>]",
"[--include=<paths>]": "[--include=<paths>]",
"<term-id>": "<term-id>",
"[--orderby=<fields>]": "[--orderby=<fields>]",
"[--tables=<tables>]": "[--tables=<tables>]",
"<taxonomy>": "<taxonomy>",
"[--docroot=<path>]": "[--docroot=<path>]",
"[--link=<link>]": "[--link=<link>]",
"[--extra-php]": "[--extra-php]",
"[--activate-network]": "[--activate-network]",
"[--site_id=<id>]": "[--site_id=<id>]",
"[--clone=<role>]": "[--clone=<role>]",
"[--exclude=<name>]": "[--exclude=<name>]",
"[--tables]": "[--tables]",
"<old>": "<old>",
"[--post_date_gmt=<post_date_gmt>]": "[--post_date_gmt=<post_date_gmt>]",
"[--start_date=<date>]": "[--start_date=<date>]",
"--dbname=<dbname>": "--dbname=<dbname>",
"<cap>": "<cap>",
"[--network_id=<network-id>]": "[--network_id=<network-id>]",
"[--set-http=<http>]": "[--set-http=<http>]",
"[--sidebar-id=<sidebar-id>]": "[--sidebar-id=<sidebar-id>]",
"[<plugin>]": "[<plugin>]",
"<file>": "<file>",
"[--post_status=<post_status>]": "[--post_status=<post_status>]",
"[--attr-title=<attr-title>]": "[--attr-title=<attr-title>]",
"[--rich_editing=<rich_editing>]": "[--rich_editing=<rich_editing>]",
"[--grant]": "[--grant]",
"[--export[=<file>]]": "[--export[=<file>]]",
"[--port=<port>]": "[--port=<port>]",
"[--exclude=<pattern>]": "[--exclude=<pattern>]",
"<title>": "<title>",
"[--max_file_size=<MB>]": "[--max_file_size=<MB>]",
"[--stats]": "[--stats]",
"[--skip-content]": "[--skip-content]",
"[<zip>]": "[<zip>]",
"[<destination>]": "[<destination>]",
"[<table>...]": "[<table>...]",
"[--dbhost=<dbhost>]": "[--dbhost=<dbhost>]",
"[--type=<type>]": "[--type=<type>]",
"<action>": "<action>",
"[--count=<number>]": "[--count=<number>]",
"[--plugin_description=<description>]": "[--plugin_description=<description>]",
"[--before_context=<num>]": "[--before_context=<num>]",
"[--skip-optimization]": "[--skip-optimization]",
"[--max_depth=<number>]": "[--max_depth=<number>]",
"<hook>": "<hook>",
"[--id_color=<color_code>]": "[--id_color=<color_code>]",
"[<expiration>]": "[<expiration>]",
"[--basic]": "[--basic]",
"[--post_content=<post_content>]": "[--post_content=<post_content>]",
"[--config=<config>]": "[--config=<config>]",
"[--label=<label>]": "[--label=<label>]",
"[--last_name=<last_name>]": "[--last_name=<last_name>]",
"[--autoload=<autoload>]": "[--autoload=<autoload>]",
"[--title=<title>]": "[--title=<title>]",
"<plugin>...": "<plugin>...",
"[--reassign=<user-id>]": "[--reassign=<user-id>]",
}
//}
//"<cap>": "<cap>",
//"[--network_id=<network-id>]": "[--network_id=<network-id>]",
//"[--set-http=<http>]": "[--set-http=<http>]",
//"[--sidebar-id=<sidebar-id>]": "[--sidebar-id=<sidebar-id>]",
//"[<plugin>]": "[<plugin>]",
//"<file>": "<file>",
//"[--post_status=<post_status>]": "[--post_status=<post_status>]",
//"[--attr-title=<attr-title>]": "[--attr-title=<attr-title>]",
//"[--rich_editing=<rich_editing>]": "[--rich_editing=<rich_editing>]",
//"[--grant]": "[--grant]",
//"[--export[=<file>]]": "[--export[=<file>]]",
//"[--port=<port>]": "[--port=<port>]",
//"[--exclude=<pattern>]": "[--exclude=<pattern>]",