squint-cljs 0.10.185 → 0.11.187
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/lib/cli.js +46 -46
- package/lib/cljs.pprint.js +229 -229
- package/lib/compiler.js +1189 -1144
- package/lib/compiler.node.js +26 -24
- package/lib/compiler.sci.js +1097 -1097
- package/lib/node.nrepl_server.js +16 -16
- package/lib/squint.core.umd.js +1 -1
- package/package.json +5 -2
- package/src/squint/core.js +8 -0
- package/src/squint/math.js +608 -0
- package/src/squint/test.mjs +503 -0
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
import * as squint_core from 'squint-cljs/core.js';
|
|
2
|
+
import * as clojure_DOT_string from 'squint-cljs/src/squint/string.js';
|
|
3
|
+
var _STAR_current_env_STAR_ = null;
|
|
4
|
+
var empty_env = function () {
|
|
5
|
+
return ({"report-counters": ({"test": 0, "pass": 0, "fail": 0, "error": 0}), "testing-vars": squint_core.list(), "testing-contexts": squint_core.list(), "once-fixtures": ({}), "each-fixtures": ({})});
|
|
6
|
+
|
|
7
|
+
};
|
|
8
|
+
var get_current_env = function () {
|
|
9
|
+
const or__23461__auto__1 = _STAR_current_env_STAR_;
|
|
10
|
+
if (squint_core.truth_(or__23461__auto__1)) {
|
|
11
|
+
return or__23461__auto__1} else {
|
|
12
|
+
return empty_env()};
|
|
13
|
+
|
|
14
|
+
};
|
|
15
|
+
var set_env_BANG_ = function (env) {
|
|
16
|
+
_STAR_current_env_STAR_ = env;
|
|
17
|
+
return env;
|
|
18
|
+
|
|
19
|
+
};
|
|
20
|
+
var clear_env_BANG_ = function () {
|
|
21
|
+
_STAR_current_env_STAR_ = null;
|
|
22
|
+
return null;
|
|
23
|
+
|
|
24
|
+
};
|
|
25
|
+
var update_current_env_BANG_ = (() => {
|
|
26
|
+
const f1 = (function (var_args) {
|
|
27
|
+
const args21 = [];
|
|
28
|
+
const len__23328__auto__2 = arguments.length;
|
|
29
|
+
let i33 = 0;
|
|
30
|
+
while(true){
|
|
31
|
+
if ((i33 < len__23328__auto__2)) {
|
|
32
|
+
args21.push((arguments[i33]));
|
|
33
|
+
let G__4 = (i33 + 1);
|
|
34
|
+
i33 = G__4;
|
|
35
|
+
continue;
|
|
36
|
+
};break;
|
|
37
|
+
}
|
|
38
|
+
;
|
|
39
|
+
const argseq__23575__auto__5 = (((2 < args21.length)) ? (args21.slice(2)) : (null));
|
|
40
|
+
return f1.cljs$core$IFn$_invoke$arity$variadic((arguments[0]), (arguments[1]), argseq__23575__auto__5);
|
|
41
|
+
|
|
42
|
+
});
|
|
43
|
+
f1.cljs$core$IFn$_invoke$arity$variadic = (function (ks, f, args) {
|
|
44
|
+
const env6 = get_current_env();
|
|
45
|
+
const new_env7 = squint_core.apply(squint_core.update_in, env6, ks, f, args);
|
|
46
|
+
return set_env_BANG_(new_env7);
|
|
47
|
+
|
|
48
|
+
});
|
|
49
|
+
f1.cljs$lang$maxFixedArity = 2;
|
|
50
|
+
return f1;
|
|
51
|
+
|
|
52
|
+
})();
|
|
53
|
+
var testing_contexts_str = function () {
|
|
54
|
+
const temp__23126__auto__1 = squint_core.seq(squint_core.get(get_current_env(), "testing-contexts"));
|
|
55
|
+
if (squint_core.truth_(temp__23126__auto__1)) {
|
|
56
|
+
const contexts2 = temp__23126__auto__1;
|
|
57
|
+
return clojure_DOT_string.join(" ", squint_core.reverse(contexts2));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
};
|
|
61
|
+
var testing_vars_str = function () {
|
|
62
|
+
const temp__23126__auto__1 = squint_core.seq(squint_core.get(get_current_env(), "testing-vars"));
|
|
63
|
+
if (squint_core.truth_(temp__23126__auto__1)) {
|
|
64
|
+
const vars2 = temp__23126__auto__1;
|
|
65
|
+
return clojure_DOT_string.join(" ", squint_core.map(squint_core.str, vars2));
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
};
|
|
69
|
+
var inc_report_counter_BANG_ = function (name) {
|
|
70
|
+
if (squint_core.truth_(squint_core.get(get_current_env(), "report-counters"))) {
|
|
71
|
+
return update_current_env_BANG_(["report-counters", name], squint_core.fnil(squint_core.inc, 0));
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
};
|
|
75
|
+
var current_test_str = function () {
|
|
76
|
+
const vars1 = testing_vars_str();
|
|
77
|
+
const ctx2 = testing_contexts_str();
|
|
78
|
+
if (squint_core.truth_((() => {
|
|
79
|
+
const and__23501__auto__3 = vars1;
|
|
80
|
+
if (squint_core.truth_(and__23501__auto__3)) {
|
|
81
|
+
return ctx2} else {
|
|
82
|
+
return and__23501__auto__3};
|
|
83
|
+
|
|
84
|
+
})())) {
|
|
85
|
+
return `${vars1??''}${" "}${ctx2??''}`} else {
|
|
86
|
+
if (squint_core.truth_(vars1)) {
|
|
87
|
+
return vars1} else {
|
|
88
|
+
if (squint_core.truth_(ctx2)) {
|
|
89
|
+
return ctx2} else {
|
|
90
|
+
if ("else") {
|
|
91
|
+
return "test"} else {
|
|
92
|
+
return null}}}};
|
|
93
|
+
|
|
94
|
+
};
|
|
95
|
+
var report = function (p__5) {
|
|
96
|
+
const map__12 = p__5;
|
|
97
|
+
const m3 = map__12;
|
|
98
|
+
const type4 = squint_core.get(map__12, "type");
|
|
99
|
+
const message5 = squint_core.get(map__12, "message");
|
|
100
|
+
const expected6 = squint_core.get(map__12, "expected");
|
|
101
|
+
const actual7 = squint_core.get(map__12, "actual");
|
|
102
|
+
const line8 = squint_core.get(map__12, "line");
|
|
103
|
+
const column9 = squint_core.get(map__12, "column");
|
|
104
|
+
const file10 = squint_core.get(map__12, "file");
|
|
105
|
+
if (squint_core.truth_(squint_core.contains_QMARK_((new Set (["pass", "fail", "error"])), type4))) {
|
|
106
|
+
inc_report_counter_BANG_(type4)};
|
|
107
|
+
const location11 = ((squint_core.truth_((() => {
|
|
108
|
+
const or__23461__auto__12 = line8;
|
|
109
|
+
if (squint_core.truth_(or__23461__auto__12)) {
|
|
110
|
+
return or__23461__auto__12} else {
|
|
111
|
+
const or__23461__auto__13 = column9;
|
|
112
|
+
if (squint_core.truth_(or__23461__auto__13)) {
|
|
113
|
+
return or__23461__auto__13} else {
|
|
114
|
+
return file10};
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
})())) ? (`${((squint_core.truth_(file10)) ? (`${file10??''}${":"}`) : (null))??''}${((squint_core.truth_(line8)) ? (line8) : (null))??''}${((squint_core.truth_(column9)) ? (`${":"}${column9??''}`) : (null))??''}`) : (null));
|
|
118
|
+
const G__614 = type4;
|
|
119
|
+
switch (G__614) {case "pass":
|
|
120
|
+
return null;
|
|
121
|
+
|
|
122
|
+
break;
|
|
123
|
+
case "fail":
|
|
124
|
+
console.error(`${"FAIL in "}${current_test_str()??''}${((squint_core.truth_(location11)) ? (`${" ("}${location11??''}${")"}`) : (null))??''}`);
|
|
125
|
+
if (squint_core.truth_(message5)) {
|
|
126
|
+
console.error(" ", message5)};
|
|
127
|
+
console.error(" expected:", squint_core.pr_str(expected6));
|
|
128
|
+
return console.error(" actual:", squint_core.pr_str(actual7));
|
|
129
|
+
|
|
130
|
+
break;
|
|
131
|
+
case "error":
|
|
132
|
+
console.error(`${"ERROR in "}${current_test_str()??''}${((squint_core.truth_(location11)) ? (`${" ("}${location11??''}${")"}`) : (null))??''}`);
|
|
133
|
+
if (squint_core.truth_(message5)) {
|
|
134
|
+
console.error(" ", message5)};
|
|
135
|
+
if (squint_core.truth_(expected6)) {
|
|
136
|
+
console.error(" expected:", squint_core.pr_str(expected6))};
|
|
137
|
+
return console.error(" actual:", squint_core.pr_str(actual7));
|
|
138
|
+
|
|
139
|
+
break;
|
|
140
|
+
case "begin-test-ns":
|
|
141
|
+
return console.log("\nTesting", `${squint_core.get(m3, "ns")??''}`);
|
|
142
|
+
|
|
143
|
+
break;
|
|
144
|
+
case "end-test-ns":
|
|
145
|
+
return null;
|
|
146
|
+
|
|
147
|
+
break;
|
|
148
|
+
case "begin-test-var":
|
|
149
|
+
return null;
|
|
150
|
+
|
|
151
|
+
break;
|
|
152
|
+
case "end-test-var":
|
|
153
|
+
return null;
|
|
154
|
+
|
|
155
|
+
break;
|
|
156
|
+
case "summary":
|
|
157
|
+
const map__1617 = squint_core.get(get_current_env(), "report-counters");
|
|
158
|
+
const test18 = squint_core.get(map__1617, "test");
|
|
159
|
+
const pass19 = squint_core.get(map__1617, "pass");
|
|
160
|
+
const fail20 = squint_core.get(map__1617, "fail");
|
|
161
|
+
const error21 = squint_core.get(map__1617, "error");
|
|
162
|
+
console.log("\nRan", test18, "tests containing", (pass19 + fail20 + error21), "assertions.");
|
|
163
|
+
return console.log(`${fail20??''}`, "failures,", `${error21??''}`, "errors.");
|
|
164
|
+
|
|
165
|
+
break;
|
|
166
|
+
default:
|
|
167
|
+
return console.log("Unknown report type:", type4, m3)};
|
|
168
|
+
|
|
169
|
+
};
|
|
170
|
+
var successful_QMARK_ = function (results) {
|
|
171
|
+
return ((squint_core.get(results, "fail", 0) === 0) && (squint_core.get(results, "error", 0) === 0));
|
|
172
|
+
|
|
173
|
+
};
|
|
174
|
+
var async_QMARK_ = function (x) {
|
|
175
|
+
const c__23426__auto__1 = Promise;
|
|
176
|
+
const x__23427__auto__2 = x;
|
|
177
|
+
const ret__23428__auto__3 = (x__23427__auto__2 instanceof c__23426__auto__1);
|
|
178
|
+
return ret__23428__auto__3;
|
|
179
|
+
|
|
180
|
+
};
|
|
181
|
+
var wrap_async = function (setup, teardown) {
|
|
182
|
+
return function (test_fn) {
|
|
183
|
+
setup();
|
|
184
|
+
const result1 = test_fn();
|
|
185
|
+
if (squint_core.truth_(async_QMARK_(result1))) {
|
|
186
|
+
return result1.finally(teardown)} else {
|
|
187
|
+
teardown();
|
|
188
|
+
return result1;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
};
|
|
194
|
+
var compose_fixtures = function (f1, f2) {
|
|
195
|
+
return function (g) {
|
|
196
|
+
return f1((function () {
|
|
197
|
+
return f2(g);
|
|
198
|
+
|
|
199
|
+
}));
|
|
200
|
+
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
};
|
|
204
|
+
var join_fixtures = function (fixtures) {
|
|
205
|
+
return squint_core.reduce(compose_fixtures, (function (f) {
|
|
206
|
+
return f();
|
|
207
|
+
|
|
208
|
+
}), fixtures);
|
|
209
|
+
|
|
210
|
+
};
|
|
211
|
+
var get_each_fixtures = (() => {
|
|
212
|
+
const f7 = (function (...args8) {
|
|
213
|
+
const G__91 = args8.length;
|
|
214
|
+
switch (G__91) {case 0:
|
|
215
|
+
return f7.cljs$core$IFn$_invoke$arity$0();
|
|
216
|
+
|
|
217
|
+
break;
|
|
218
|
+
case 1:
|
|
219
|
+
return f7.cljs$core$IFn$_invoke$arity$1(args8[0]);
|
|
220
|
+
|
|
221
|
+
break;
|
|
222
|
+
default:
|
|
223
|
+
throw (new Error(`${"Invalid arity: "}${args8.length??''}`))};
|
|
224
|
+
|
|
225
|
+
});
|
|
226
|
+
f7.cljs$core$IFn$_invoke$arity$0 = (function () {
|
|
227
|
+
return get_each_fixtures(null);
|
|
228
|
+
|
|
229
|
+
});
|
|
230
|
+
f7.cljs$core$IFn$_invoke$arity$1 = (function (ns_str) {
|
|
231
|
+
return squint_core.get_in(get_current_env(), ["each-fixtures", ns_str], []);
|
|
232
|
+
|
|
233
|
+
});
|
|
234
|
+
f7.cljs$lang$maxFixedArity = 1;
|
|
235
|
+
return f7;
|
|
236
|
+
|
|
237
|
+
})();
|
|
238
|
+
var set_each_fixtures_BANG_ = (() => {
|
|
239
|
+
const f10 = (function (...args11) {
|
|
240
|
+
const G__121 = args11.length;
|
|
241
|
+
switch (G__121) {case 1:
|
|
242
|
+
return f10.cljs$core$IFn$_invoke$arity$1(args11[0]);
|
|
243
|
+
|
|
244
|
+
break;
|
|
245
|
+
case 2:
|
|
246
|
+
return f10.cljs$core$IFn$_invoke$arity$2(args11[0], args11[1]);
|
|
247
|
+
|
|
248
|
+
break;
|
|
249
|
+
default:
|
|
250
|
+
throw (new Error(`${"Invalid arity: "}${args11.length??''}`))};
|
|
251
|
+
|
|
252
|
+
});
|
|
253
|
+
f10.cljs$core$IFn$_invoke$arity$1 = (function (fixtures) {
|
|
254
|
+
return set_each_fixtures_BANG_(null, fixtures);
|
|
255
|
+
|
|
256
|
+
});
|
|
257
|
+
f10.cljs$core$IFn$_invoke$arity$2 = (function (ns_str, fixtures) {
|
|
258
|
+
return update_current_env_BANG_(["each-fixtures", ns_str], squint_core.constantly(fixtures));
|
|
259
|
+
|
|
260
|
+
});
|
|
261
|
+
f10.cljs$lang$maxFixedArity = 2;
|
|
262
|
+
return f10;
|
|
263
|
+
|
|
264
|
+
})();
|
|
265
|
+
var get_once_fixtures = (() => {
|
|
266
|
+
const f13 = (function (...args14) {
|
|
267
|
+
const G__151 = args14.length;
|
|
268
|
+
switch (G__151) {case 0:
|
|
269
|
+
return f13.cljs$core$IFn$_invoke$arity$0();
|
|
270
|
+
|
|
271
|
+
break;
|
|
272
|
+
case 1:
|
|
273
|
+
return f13.cljs$core$IFn$_invoke$arity$1(args14[0]);
|
|
274
|
+
|
|
275
|
+
break;
|
|
276
|
+
default:
|
|
277
|
+
throw (new Error(`${"Invalid arity: "}${args14.length??''}`))};
|
|
278
|
+
|
|
279
|
+
});
|
|
280
|
+
f13.cljs$core$IFn$_invoke$arity$0 = (function () {
|
|
281
|
+
return get_once_fixtures(null);
|
|
282
|
+
|
|
283
|
+
});
|
|
284
|
+
f13.cljs$core$IFn$_invoke$arity$1 = (function (ns_str) {
|
|
285
|
+
return squint_core.get_in(get_current_env(), ["once-fixtures", ns_str], []);
|
|
286
|
+
|
|
287
|
+
});
|
|
288
|
+
f13.cljs$lang$maxFixedArity = 1;
|
|
289
|
+
return f13;
|
|
290
|
+
|
|
291
|
+
})();
|
|
292
|
+
var set_once_fixtures_BANG_ = (() => {
|
|
293
|
+
const f16 = (function (...args17) {
|
|
294
|
+
const G__181 = args17.length;
|
|
295
|
+
switch (G__181) {case 1:
|
|
296
|
+
return f16.cljs$core$IFn$_invoke$arity$1(args17[0]);
|
|
297
|
+
|
|
298
|
+
break;
|
|
299
|
+
case 2:
|
|
300
|
+
return f16.cljs$core$IFn$_invoke$arity$2(args17[0], args17[1]);
|
|
301
|
+
|
|
302
|
+
break;
|
|
303
|
+
default:
|
|
304
|
+
throw (new Error(`${"Invalid arity: "}${args17.length??''}`))};
|
|
305
|
+
|
|
306
|
+
});
|
|
307
|
+
f16.cljs$core$IFn$_invoke$arity$1 = (function (fixtures) {
|
|
308
|
+
return set_once_fixtures_BANG_(null, fixtures);
|
|
309
|
+
|
|
310
|
+
});
|
|
311
|
+
f16.cljs$core$IFn$_invoke$arity$2 = (function (ns_str, fixtures) {
|
|
312
|
+
return update_current_env_BANG_(["once-fixtures", ns_str], squint_core.constantly(fixtures));
|
|
313
|
+
|
|
314
|
+
});
|
|
315
|
+
f16.cljs$lang$maxFixedArity = 2;
|
|
316
|
+
return f16;
|
|
317
|
+
|
|
318
|
+
})();
|
|
319
|
+
var test_var = function (v) {
|
|
320
|
+
if (squint_core.truth_(squint_core.fn_QMARK_(v))) {
|
|
321
|
+
const test_name1 = (() => {
|
|
322
|
+
const or__23461__auto__2 = squint_core.get(squint_core.meta(v), "name");
|
|
323
|
+
if (squint_core.truth_(or__23461__auto__2)) {
|
|
324
|
+
return or__23461__auto__2} else {
|
|
325
|
+
return "anonymous"};
|
|
326
|
+
|
|
327
|
+
})();
|
|
328
|
+
const ns_str3 = squint_core.get(squint_core.meta(v), "ns");
|
|
329
|
+
const each_fixtures4 = (() => {
|
|
330
|
+
const per_ns5 = get_each_fixtures(ns_str3);
|
|
331
|
+
if (squint_core.truth_(squint_core.seq(per_ns5))) {
|
|
332
|
+
return per_ns5} else {
|
|
333
|
+
return get_each_fixtures()};
|
|
334
|
+
|
|
335
|
+
})();
|
|
336
|
+
const wrapped_test6 = ((squint_core.truth_(squint_core.seq(each_fixtures4))) ? ((function () {
|
|
337
|
+
return join_fixtures(each_fixtures4)(v);
|
|
338
|
+
|
|
339
|
+
})) : (v));
|
|
340
|
+
const pop_test_name_BANG_7 = (function () {
|
|
341
|
+
return update_current_env_BANG_(["testing-vars"], squint_core.rest);
|
|
342
|
+
|
|
343
|
+
});
|
|
344
|
+
update_current_env_BANG_(["testing-vars"], squint_core.conj, test_name1);
|
|
345
|
+
inc_report_counter_BANG_("test");
|
|
346
|
+
return (() => {
|
|
347
|
+
try{
|
|
348
|
+
const result8 = wrapped_test6();
|
|
349
|
+
if (squint_core.truth_(async_QMARK_(result8))) {
|
|
350
|
+
return result8.then((function (r) {
|
|
351
|
+
pop_test_name_BANG_7();
|
|
352
|
+
return r;
|
|
353
|
+
|
|
354
|
+
})).catch((function (e) {
|
|
355
|
+
report(({"type": "error", "message": e.message, "expected": null, "actual": e}));
|
|
356
|
+
return pop_test_name_BANG_7();
|
|
357
|
+
|
|
358
|
+
}))} else {
|
|
359
|
+
pop_test_name_BANG_7();
|
|
360
|
+
return result8;
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
catch(e9){
|
|
364
|
+
pop_test_name_BANG_7();
|
|
365
|
+
return report(({"type": "error", "message": e9.message, "expected": null, "actual": e9}));
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
})();
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
};
|
|
372
|
+
var test_registry = squint_core.atom(({}));
|
|
373
|
+
var register_test_BANG_ = function (ns_str, test_fn) {
|
|
374
|
+
const test_name1 = squint_core.get(squint_core.meta(test_fn), "name");
|
|
375
|
+
squint_core.swap_BANG_(test_registry, squint_core.assoc_in, [ns_str, test_name1], test_fn);
|
|
376
|
+
return test_fn;
|
|
377
|
+
|
|
378
|
+
};
|
|
379
|
+
var registered_tests = (() => {
|
|
380
|
+
const f19 = (function (...args20) {
|
|
381
|
+
const G__211 = args20.length;
|
|
382
|
+
switch (G__211) {case 0:
|
|
383
|
+
return f19.cljs$core$IFn$_invoke$arity$0();
|
|
384
|
+
|
|
385
|
+
break;
|
|
386
|
+
case 1:
|
|
387
|
+
return f19.cljs$core$IFn$_invoke$arity$1(args20[0]);
|
|
388
|
+
|
|
389
|
+
break;
|
|
390
|
+
default:
|
|
391
|
+
throw (new Error(`${"Invalid arity: "}${args20.length??''}`))};
|
|
392
|
+
|
|
393
|
+
});
|
|
394
|
+
f19.cljs$core$IFn$_invoke$arity$0 = (function () {
|
|
395
|
+
return squint_core.vec(squint_core.mapcat(squint_core.vals, squint_core.vals(squint_core.deref(test_registry))));
|
|
396
|
+
|
|
397
|
+
});
|
|
398
|
+
f19.cljs$core$IFn$_invoke$arity$1 = (function (ns_str) {
|
|
399
|
+
return squint_core.vec(squint_core.vals(squint_core.get(squint_core.deref(test_registry), ns_str)));
|
|
400
|
+
|
|
401
|
+
});
|
|
402
|
+
f19.cljs$lang$maxFixedArity = 1;
|
|
403
|
+
return f19;
|
|
404
|
+
|
|
405
|
+
})();
|
|
406
|
+
var run_vars_with_once_fixtures = function (ns_str, vars) {
|
|
407
|
+
const per_ns1 = get_once_fixtures(ns_str);
|
|
408
|
+
const once_fixtures2 = ((squint_core.truth_(squint_core.seq(per_ns1))) ? (per_ns1) : (get_once_fixtures()));
|
|
409
|
+
const run_all3 = (function () {
|
|
410
|
+
return squint_core.reduce((function (chain, v) {
|
|
411
|
+
if (squint_core.truth_(async_QMARK_(chain))) {
|
|
412
|
+
return chain.then((function (_) {
|
|
413
|
+
return test_var(v);
|
|
414
|
+
|
|
415
|
+
}))} else {
|
|
416
|
+
return test_var(v)};
|
|
417
|
+
|
|
418
|
+
}), null, vars);
|
|
419
|
+
|
|
420
|
+
});
|
|
421
|
+
const run_with_fixtures4 = (function () {
|
|
422
|
+
if (squint_core.truth_(squint_core.seq(once_fixtures2))) {
|
|
423
|
+
return join_fixtures(once_fixtures2)(run_all3)} else {
|
|
424
|
+
return run_all3()};
|
|
425
|
+
|
|
426
|
+
});
|
|
427
|
+
if (squint_core.truth_(ns_str)) {
|
|
428
|
+
report(({"type": "begin-test-ns", "ns": ns_str}))};
|
|
429
|
+
const chain5 = run_with_fixtures4();
|
|
430
|
+
const finish6 = (function (r) {
|
|
431
|
+
if (squint_core.truth_(ns_str)) {
|
|
432
|
+
report(({"type": "end-test-ns", "ns": ns_str}))};
|
|
433
|
+
return r;
|
|
434
|
+
|
|
435
|
+
});
|
|
436
|
+
if (squint_core.truth_(async_QMARK_(chain5))) {
|
|
437
|
+
return chain5.then(finish6)} else {
|
|
438
|
+
return finish6(chain5)};
|
|
439
|
+
|
|
440
|
+
};
|
|
441
|
+
var fresh_counters = ({"test": 0, "pass": 0, "fail": 0, "error": 0});
|
|
442
|
+
var run_tests = (() => {
|
|
443
|
+
const f22 = (function (var_args) {
|
|
444
|
+
const args231 = [];
|
|
445
|
+
const len__23328__auto__2 = arguments.length;
|
|
446
|
+
let i243 = 0;
|
|
447
|
+
while(true){
|
|
448
|
+
if ((i243 < len__23328__auto__2)) {
|
|
449
|
+
args231.push((arguments[i243]));
|
|
450
|
+
let G__4 = (i243 + 1);
|
|
451
|
+
i243 = G__4;
|
|
452
|
+
continue;
|
|
453
|
+
};break;
|
|
454
|
+
}
|
|
455
|
+
;
|
|
456
|
+
const argseq__23575__auto__5 = (((0 < args231.length)) ? (args231.slice(0)) : (null));
|
|
457
|
+
return f22.cljs$core$IFn$_invoke$arity$variadic(argseq__23575__auto__5);
|
|
458
|
+
|
|
459
|
+
});
|
|
460
|
+
f22.cljs$core$IFn$_invoke$arity$variadic = (function (args) {
|
|
461
|
+
const test_vars6 = ((squint_core.truth_(squint_core.empty_QMARK_(args))) ? (registered_tests()) : (((squint_core.truth_(squint_core.string_QMARK_(squint_core.first(args)))) ? (squint_core.vec(squint_core.mapcat(registered_tests, args))) : ((("else") ? (args) : (null))))));
|
|
462
|
+
const _7 = (((_STAR_current_env_STAR_ == null)) ? (set_env_BANG_(empty_env())) : (null));
|
|
463
|
+
const saved_counters8 = squint_core.get(get_current_env(), "report-counters");
|
|
464
|
+
const _9 = update_current_env_BANG_(["report-counters"], squint_core.constantly(fresh_counters));
|
|
465
|
+
const groups10 = squint_core.reduce((function (acc, v) {
|
|
466
|
+
const k11 = squint_core.get(squint_core.meta(v), "ns");
|
|
467
|
+
return squint_core.update(acc, k11, squint_core.fnil(squint_core.conj, []), v);
|
|
468
|
+
|
|
469
|
+
}), ({}), test_vars6);
|
|
470
|
+
const run_groups12 = (function () {
|
|
471
|
+
return squint_core.reduce((function (chain, p__26) {
|
|
472
|
+
const vec__1316 = p__26;
|
|
473
|
+
const ns_str17 = squint_core.nth(vec__1316, 0, null);
|
|
474
|
+
const vars18 = squint_core.nth(vec__1316, 1, null);
|
|
475
|
+
if (squint_core.truth_(async_QMARK_(chain))) {
|
|
476
|
+
return chain.then((function (_) {
|
|
477
|
+
return run_vars_with_once_fixtures(ns_str17, vars18);
|
|
478
|
+
|
|
479
|
+
}))} else {
|
|
480
|
+
return run_vars_with_once_fixtures(ns_str17, vars18)};
|
|
481
|
+
|
|
482
|
+
}), null, groups10);
|
|
483
|
+
|
|
484
|
+
});
|
|
485
|
+
const finish19 = (function (_) {
|
|
486
|
+
report(({"type": "summary"}));
|
|
487
|
+
const counters20 = squint_core.get(get_current_env(), "report-counters");
|
|
488
|
+
update_current_env_BANG_(["report-counters"], squint_core.constantly(saved_counters8));
|
|
489
|
+
return counters20;
|
|
490
|
+
|
|
491
|
+
});
|
|
492
|
+
const chain21 = run_groups12();
|
|
493
|
+
if (squint_core.truth_(async_QMARK_(chain21))) {
|
|
494
|
+
return chain21.then(finish19)} else {
|
|
495
|
+
return finish19(null)};
|
|
496
|
+
|
|
497
|
+
});
|
|
498
|
+
f22.cljs$lang$maxFixedArity = 0;
|
|
499
|
+
return f22;
|
|
500
|
+
|
|
501
|
+
})();
|
|
502
|
+
|
|
503
|
+
export { _STAR_current_env_STAR_, get_once_fixtures, get_each_fixtures, update_current_env_BANG_, current_test_str, wrap_async, register_test_BANG_, empty_env, testing_contexts_str, async_QMARK_, get_current_env, testing_vars_str, run_tests, set_each_fixtures_BANG_, registered_tests, clear_env_BANG_, set_env_BANG_, report, inc_report_counter_BANG_, test_var, compose_fixtures, successful_QMARK_, set_once_fixtures_BANG_, join_fixtures }
|