You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It uses standard `go test`. Some method are "exposed" with Capital name only for testing purpose.
@@ -119,14 +156,14 @@ Options loop test JSON: [`common_input_test.json`](../common_input_test.json)
119
156
This is our input file for testing options parsed recieved from docopt lib. We emulate docopt parsed options and give
120
157
them as input to our method.
121
158
122
-
JSON tests are read as a list of test: (others json keys should be ignored and are used as comment)
159
+
JSON tests are read as a list of test: (others JSON keys should be ignored and are used as comment)
123
160
Our parser JSON parser / loader [`test_json_load.go`](../test_json_load/test_json_load.go), only used for testing.
124
161
125
162
```go
126
163
typeTestStringstruct {
127
-
Inputmap[string]interface{}
128
-
Expect_args []string
129
-
Expect_global []string
164
+
Inputmap[string]interface{}
165
+
Expect_args[]string
166
+
Expect_global[]string
130
167
Expect_global_prefix []string// optional
131
168
}
132
169
```
@@ -153,25 +190,29 @@ add a new bloc of JSON object (dict / hash / map):
153
190
],
154
191
"expect_global": [
155
192
"FILE=('pipo' 'molo' 'toto')"
193
+
],
194
+
"expect_global_prefix": [
195
+
"ARGS_FILE=('pipo' 'molo' 'toto')"
156
196
]
157
197
},
158
198
```
159
199
160
200
*`description` a comment which is ignored
161
-
* other extra JSON key that are not the 3 following will be ignored too.
201
+
* other extra JSON key that are not the 4 following will be ignored too.
162
202
*`input` correspond to the `map[string]interface{}` of docopt parsed options.
163
203
*`expect_args` the text rows of the associative array code for bash4 that is outputed by `Print_bash_args()` matched in order.
164
204
*`expect_global` the text definition of the bash global vars that is outputed by `Print_bash_global()` matched in order.
165
205
*`expect_global_prefix`[optional] if present will be used for testing `Mangle_key` + `Global_prefix` instead of [`rewrite_prefix("ARGS",)`](../docopts_test.go)
166
-
So in `expect_global_prefix` the prefix must be `ARGS` + `_`.
206
+
So left hand values in `expect_global_prefix` the prefix must be `ARGS` + `_`.
167
207
168
208
169
209
### testcases.docopt (agnostic test universal to docopt parsing language)
170
210
171
-
This file is still avaible from python docopt original repository too [testcases.docopt](https://github.com/docopt/docopt/blob/511d1c57b59cd2ed663a9f9e181b5160ce97e728/testcases.docopt)
211
+
This file is still avaible from python docopt lib original repository
212
+
too [testcases.docopt](https://github.com/docopt/docopt/blob/511d1c57b59cd2ed663a9f9e181b5160ce97e728/testcases.docopt)
172
213
173
214
This is the input file used by `language_agnostic_tester.py`, which is a middleware originaly written to read
174
-
`testcases.docopt` and to send it to ~> `testee.sh`~> `docopts`~> JSON ~> the result is the validated against the
215
+
`testcases.docopt` and to send it to ~> `testee.sh`~> `docopts -A`~> JSON ~> the result is the validated against the
175
216
embedded JSON expected result.
176
217
177
218
Input file format is historically as follow:
@@ -191,7 +232,7 @@ $ prog -a
191
232
192
233
## Golang debugger
193
234
194
-
Debugger is a must for any programming language. Go provide an extrenal debugger named [delve](https://github.com/go-delve/delve)
235
+
Debugger is a must for any programming language. Go provides an extrenal debugger named [delve](https://github.com/go-delve/delve)
0 commit comments