podlite 0.0.83 → 0.0.84
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/CHANGELOG.podlite +90 -0
- package/esm/assemble/async.d.ts +31 -0
- package/esm/assemble/async.js +113 -0
- package/esm/assemble/async.js.map +1 -0
- package/esm/assemble/files.d.ts +2 -0
- package/esm/assemble/files.js +77 -0
- package/esm/assemble/files.js.map +1 -0
- package/esm/assemble/index.d.ts +59 -0
- package/esm/assemble/index.js +1003 -0
- package/esm/assemble/index.js.map +1 -0
- package/esm/cli.js +151 -26
- package/esm/cli.js.map +1 -1
- package/esm/file-format.d.ts +3 -0
- package/esm/file-format.js +53 -0
- package/esm/file-format.js.map +1 -0
- package/esm/index.d.ts +4 -0
- package/esm/index.js +3 -0
- package/esm/index.js.map +1 -1
- package/esm/lint/grammar/scan.d.ts +1 -1
- package/esm/lint/grammar/scan.js +2 -1
- package/esm/lint/grammar/scan.js.map +1 -1
- package/esm/lint/index.d.ts +1 -1
- package/esm/lint/index.js +3 -3
- package/esm/lint/index.js.map +1 -1
- package/esm/lint/loader.js +5 -4
- package/esm/lint/loader.js.map +1 -1
- package/esm/lint/mute.js +2 -1
- package/esm/lint/mute.js.map +1 -1
- package/esm/lint/rules/include-resolves.d.ts +6 -0
- package/esm/lint/rules/include-resolves.js +89 -0
- package/esm/lint/rules/include-resolves.js.map +1 -0
- package/esm/lint/rules/index.js +2 -0
- package/esm/lint/rules/index.js.map +1 -1
- package/esm/lint/rules/table-shape.js +7 -1
- package/esm/lint/rules/table-shape.js.map +1 -1
- package/esm/lint/types.d.ts +6 -1
- package/esm/lint/types.js.map +1 -1
- package/esm/query-blocks.d.ts +6 -0
- package/esm/query-blocks.js +127 -0
- package/esm/query-blocks.js.map +1 -0
- package/esm/query.d.ts +2 -0
- package/esm/query.js +233 -26
- package/esm/query.js.map +1 -1
- package/esm/reader.d.ts +15 -0
- package/esm/reader.js +119 -0
- package/esm/reader.js.map +1 -0
- package/esm/refresh-tocs.d.ts +2 -0
- package/esm/refresh-tocs.js +52 -0
- package/esm/refresh-tocs.js.map +1 -0
- package/esm/resolve-includes.d.ts +27 -1
- package/esm/resolve-includes.js +80 -40
- package/esm/resolve-includes.js.map +1 -1
- package/esm/test/collect.d.ts +16 -0
- package/esm/test/collect.js +368 -0
- package/esm/test/collect.js.map +1 -0
- package/esm/test/documents.d.ts +47 -0
- package/esm/test/documents.js +211 -0
- package/esm/test/documents.js.map +1 -0
- package/esm/test/evaluate.d.ts +41 -0
- package/esm/test/evaluate.js +104 -0
- package/esm/test/evaluate.js.map +1 -0
- package/esm/test/formatters/json.d.ts +2 -0
- package/esm/test/formatters/json.js +11 -0
- package/esm/test/formatters/json.js.map +1 -0
- package/esm/test/formatters/text.d.ts +2 -0
- package/esm/test/formatters/text.js +104 -0
- package/esm/test/formatters/text.js.map +1 -0
- package/esm/test/index.d.ts +11 -0
- package/esm/test/index.js +19 -0
- package/esm/test/index.js.map +1 -0
- package/esm/test/resources.d.ts +5 -0
- package/esm/test/resources.js +45 -0
- package/esm/test/resources.js.map +1 -0
- package/esm/test/run.d.ts +52 -0
- package/esm/test/run.js +91 -0
- package/esm/test/run.js.map +1 -0
- package/esm/test/sources.d.ts +48 -0
- package/esm/test/sources.js +162 -0
- package/esm/test/sources.js.map +1 -0
- package/esm/test/types.d.ts +104 -0
- package/esm/test/types.js +3 -0
- package/esm/test/types.js.map +1 -0
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/lib/assemble/async.d.ts +31 -0
- package/lib/assemble/async.js +118 -0
- package/lib/assemble/async.js.map +1 -0
- package/lib/assemble/files.d.ts +2 -0
- package/lib/assemble/files.js +81 -0
- package/lib/assemble/files.js.map +1 -0
- package/lib/assemble/index.d.ts +59 -0
- package/lib/assemble/index.js +1013 -0
- package/lib/assemble/index.js.map +1 -0
- package/lib/cli.js +149 -24
- package/lib/cli.js.map +1 -1
- package/lib/file-format.d.ts +3 -0
- package/lib/file-format.js +58 -0
- package/lib/file-format.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +22 -1
- package/lib/index.js.map +1 -1
- package/lib/lint/grammar/scan.d.ts +1 -1
- package/lib/lint/grammar/scan.js +2 -1
- package/lib/lint/grammar/scan.js.map +1 -1
- package/lib/lint/index.d.ts +1 -1
- package/lib/lint/index.js +3 -3
- package/lib/lint/index.js.map +1 -1
- package/lib/lint/loader.js +5 -4
- package/lib/lint/loader.js.map +1 -1
- package/lib/lint/mute.js +2 -1
- package/lib/lint/mute.js.map +1 -1
- package/lib/lint/rules/include-resolves.d.ts +6 -0
- package/lib/lint/rules/include-resolves.js +92 -0
- package/lib/lint/rules/include-resolves.js.map +1 -0
- package/lib/lint/rules/index.js +2 -0
- package/lib/lint/rules/index.js.map +1 -1
- package/lib/lint/rules/table-shape.js +7 -1
- package/lib/lint/rules/table-shape.js.map +1 -1
- package/lib/lint/types.d.ts +6 -1
- package/lib/lint/types.js.map +1 -1
- package/lib/query-blocks.d.ts +6 -0
- package/lib/query-blocks.js +136 -0
- package/lib/query-blocks.js.map +1 -0
- package/lib/query.d.ts +2 -0
- package/lib/query.js +232 -25
- package/lib/query.js.map +1 -1
- package/lib/reader.d.ts +15 -0
- package/lib/reader.js +124 -0
- package/lib/reader.js.map +1 -0
- package/lib/refresh-tocs.d.ts +2 -0
- package/lib/refresh-tocs.js +56 -0
- package/lib/refresh-tocs.js.map +1 -0
- package/lib/resolve-includes.d.ts +27 -1
- package/lib/resolve-includes.js +84 -40
- package/lib/resolve-includes.js.map +1 -1
- package/lib/test/collect.d.ts +16 -0
- package/lib/test/collect.js +374 -0
- package/lib/test/collect.js.map +1 -0
- package/lib/test/documents.d.ts +47 -0
- package/lib/test/documents.js +250 -0
- package/lib/test/documents.js.map +1 -0
- package/lib/test/evaluate.d.ts +41 -0
- package/lib/test/evaluate.js +142 -0
- package/lib/test/evaluate.js.map +1 -0
- package/lib/test/formatters/json.d.ts +2 -0
- package/lib/test/formatters/json.js +15 -0
- package/lib/test/formatters/json.js.map +1 -0
- package/lib/test/formatters/text.d.ts +2 -0
- package/lib/test/formatters/text.js +141 -0
- package/lib/test/formatters/text.js.map +1 -0
- package/lib/test/index.d.ts +11 -0
- package/lib/test/index.js +31 -0
- package/lib/test/index.js.map +1 -0
- package/lib/test/resources.d.ts +5 -0
- package/lib/test/resources.js +83 -0
- package/lib/test/resources.js.map +1 -0
- package/lib/test/run.d.ts +52 -0
- package/lib/test/run.js +95 -0
- package/lib/test/run.js.map +1 -0
- package/lib/test/sources.d.ts +48 -0
- package/lib/test/sources.js +200 -0
- package/lib/test/sources.js.map +1 -0
- package/lib/test/types.d.ts +104 -0
- package/lib/test/types.js +8 -0
- package/lib/test/types.js.map +1 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +28 -7
package/lib/resolve-includes.js
CHANGED
|
@@ -33,12 +33,15 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.resolveIncludes = void 0;
|
|
36
|
+
exports.describeProblem = exports.resolveIncludes = exports.diskProvider = exports.expandMask = exports.hasMask = exports.isWarning = void 0;
|
|
37
37
|
const fs = __importStar(require("fs"));
|
|
38
38
|
const path = __importStar(require("path"));
|
|
39
39
|
const schema_1 = require("@podlite/schema");
|
|
40
|
-
const
|
|
40
|
+
const assemble_1 = require("./assemble");
|
|
41
|
+
var assemble_2 = require("./assemble");
|
|
42
|
+
Object.defineProperty(exports, "isWarning", { enumerable: true, get: function () { return assemble_2.isWarning; } });
|
|
41
43
|
const hasMask = (target) => /[*?]/.test(target);
|
|
44
|
+
exports.hasMask = hasMask;
|
|
42
45
|
const reachesSubdirs = (target) => target.includes('**');
|
|
43
46
|
// A mask that crosses directories could otherwise walk a whole disk from a
|
|
44
47
|
// short prefix.
|
|
@@ -47,7 +50,7 @@ const maxDepth = 32;
|
|
|
47
50
|
// by the selector itself, which already knows the pattern language.
|
|
48
51
|
const fixedPrefix = (target) => {
|
|
49
52
|
const parts = target.split('/');
|
|
50
|
-
const upto = parts.findIndex(hasMask);
|
|
53
|
+
const upto = parts.findIndex(exports.hasMask);
|
|
51
54
|
return parts.slice(0, upto === -1 ? parts.length : upto).join('/');
|
|
52
55
|
};
|
|
53
56
|
const listDir = (dir, deep, depth = 0) => {
|
|
@@ -71,48 +74,89 @@ const listDir = (dir, deep, depth = 0) => {
|
|
|
71
74
|
// the selector matches them back. Matching runs before the file is read: the
|
|
72
75
|
// directory may hold anything, and a mask that does not name it must not send
|
|
73
76
|
// it through the parser.
|
|
74
|
-
const expandMask = (target, baseDir) => {
|
|
77
|
+
const expandMask = (target, baseDir, provider) => {
|
|
75
78
|
const prefix = fixedPrefix(target);
|
|
76
|
-
return
|
|
79
|
+
return provider
|
|
80
|
+
.list(path.resolve(baseDir, prefix), reachesSubdirs(target))
|
|
77
81
|
.map(name => (prefix ? `${prefix}/${name}` : name))
|
|
78
82
|
.filter(file => (0, schema_1.filePathMatches)(file, target));
|
|
79
83
|
};
|
|
80
|
-
|
|
81
|
-
const
|
|
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
|
-
|
|
84
|
+
exports.expandMask = expandMask;
|
|
85
|
+
const readSource = (target) => {
|
|
86
|
+
try {
|
|
87
|
+
return fs.statSync(target).isFile() ? fs.readFileSync(target, 'utf-8') : null;
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
// the native call gives the case the disk has, so a path written in another case
|
|
94
|
+
// still compares equal on a disk that ignores case
|
|
95
|
+
const realPath = (file) => {
|
|
96
|
+
try {
|
|
97
|
+
return fs.realpathSync.native(file);
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
exports.diskProvider = {
|
|
104
|
+
read: readSource,
|
|
105
|
+
list: (dir, deep) => listDir(dir, deep),
|
|
106
|
+
real: realPath,
|
|
107
|
+
};
|
|
108
|
+
const isUnder = (file, dir) => {
|
|
109
|
+
const relative = path.relative(dir, file);
|
|
110
|
+
return relative !== '..' && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative);
|
|
111
|
+
};
|
|
112
|
+
// The disk and a provider of the earlier shape, as sources: a path is resolved
|
|
113
|
+
// against the directory of the text it is written in, and a file is its own
|
|
114
|
+
// absolute path.
|
|
115
|
+
const sourcesOf = (provider, root) => {
|
|
116
|
+
const given = root === undefined ? undefined : path.resolve(root);
|
|
117
|
+
const realRoot = given === undefined ? null : provider.real?.(given) ?? null;
|
|
118
|
+
const outside = (id) => {
|
|
119
|
+
if (realRoot === null)
|
|
120
|
+
return undefined;
|
|
121
|
+
const real = provider.real?.(id);
|
|
122
|
+
return real && !isUnder(real, realRoot) ? `outside the root ${given}` : undefined;
|
|
114
123
|
};
|
|
115
|
-
return
|
|
124
|
+
return {
|
|
125
|
+
locate: (written, context, plain) => {
|
|
126
|
+
const baseDir = String(context);
|
|
127
|
+
const masked = !plain && (0, exports.hasMask)(written);
|
|
128
|
+
const names = masked ? (0, exports.expandMask)(written, baseDir, provider) : [written];
|
|
129
|
+
return {
|
|
130
|
+
masked,
|
|
131
|
+
sources: names.map(name => {
|
|
132
|
+
const id = path.resolve(baseDir, name);
|
|
133
|
+
const external = outside(id);
|
|
134
|
+
return external === undefined
|
|
135
|
+
? { id, name, context: path.dirname(id) }
|
|
136
|
+
: { id, name, context: path.dirname(id), external };
|
|
137
|
+
}),
|
|
138
|
+
};
|
|
139
|
+
},
|
|
140
|
+
read: source => provider.read(source.id),
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
const resolveIncludes = (tree, opts) => {
|
|
144
|
+
const { baseDir, provider, self, root, ...rest } = opts;
|
|
145
|
+
return (0, assemble_1.assembleIncludes)(tree, {
|
|
146
|
+
...rest,
|
|
147
|
+
sources: sourcesOf(provider ?? exports.diskProvider, root),
|
|
148
|
+
context: baseDir,
|
|
149
|
+
self: self ? path.resolve(self) : undefined,
|
|
150
|
+
});
|
|
116
151
|
};
|
|
117
152
|
exports.resolveIncludes = resolveIncludes;
|
|
153
|
+
// Where a problem was met: the directive it was found at, its file as the
|
|
154
|
+
// command line names it, or from the working directory when absolute.
|
|
155
|
+
const describeProblem = (problem) => {
|
|
156
|
+
const at = problem.chain[problem.chain.length - 1];
|
|
157
|
+
const line = at?.location ? `:${at.location.start.line}` : '';
|
|
158
|
+
const file = at ? (path.isAbsolute(at.file) ? path.relative(process.cwd(), at.file) : at.file) : '<document>';
|
|
159
|
+
return `${file}${line}: ${problem.message}`;
|
|
160
|
+
};
|
|
161
|
+
exports.describeProblem = describeProblem;
|
|
118
162
|
//# sourceMappingURL=resolve-includes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-includes.js","sourceRoot":"","sources":["../src/resolve-includes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAwB;AACxB,2CAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"resolve-includes.js","sourceRoot":"","sources":["../src/resolve-includes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAwB;AACxB,2CAA4B;AAC5B,4CAA8D;AAC9D,yCAAqF;AAGrF,uCAAsC;AAA7B,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AAE,CAAA;IAC7D,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAA;IAC7G,OAAO,GAAG,IAAI,GAAG,IAAI,KAAK,OAAO,CAAC,OAAO,EAAE,CAAA;AAC7C,CAAC,CAAA;AALY,QAAA,eAAe,mBAK3B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PreparedDocument, Profile } from './documents';
|
|
2
|
+
import type { CollectedTest, CollectionProblem, PlannedRun, TestSource } from './types';
|
|
3
|
+
export type PreparedSource = PreparedDocument & {
|
|
4
|
+
index: number;
|
|
5
|
+
};
|
|
6
|
+
export type Collection = {
|
|
7
|
+
sources: PreparedSource[];
|
|
8
|
+
tests: CollectedTest[];
|
|
9
|
+
problems: CollectionProblem[];
|
|
10
|
+
};
|
|
11
|
+
export declare const splitSource: (expression: string) => {
|
|
12
|
+
source?: string;
|
|
13
|
+
selection: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const collectTests: (sources: TestSource[], profile?: Profile) => Collection;
|
|
16
|
+
export declare const planRuns: (tests: CollectedTest[], supplied: number) => PlannedRun[];
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.planRuns = exports.collectTests = exports.splitSource = void 0;
|
|
4
|
+
const schema_1 = require("@podlite/schema");
|
|
5
|
+
const documents_1 = require("./documents");
|
|
6
|
+
const resources_1 = require("./resources");
|
|
7
|
+
const types_1 = require("./types");
|
|
8
|
+
const isObject = (value) => typeof value === 'object' && value !== null;
|
|
9
|
+
const isBlock = (value) => isObject(value) && value.type === 'block' && typeof value.name === 'string';
|
|
10
|
+
const isLocation = (value) => isObject(value) && isObject(value.start) && typeof value.start.offset === 'number';
|
|
11
|
+
const childrenOf = (value) => isObject(value) && Array.isArray(value.content) ? value.content : Array.isArray(value) ? value : [];
|
|
12
|
+
const option = (block, name) => (block.config ?? []).find(c => c.name === name)?.value;
|
|
13
|
+
const stringOption = (block, name) => {
|
|
14
|
+
const value = option(block, name);
|
|
15
|
+
return typeof value === 'string' ? value : undefined;
|
|
16
|
+
};
|
|
17
|
+
const bodyOf = (block) => childrenOf(block)
|
|
18
|
+
.map(c => (isObject(c) && c.type === 'verbatim' && typeof c.value === 'string' ? c.value : ''))
|
|
19
|
+
.join('');
|
|
20
|
+
// The vertical bar is what tells a source from a block name; one inside quotes
|
|
21
|
+
// or brackets belongs to a value or to an operand of `in`.
|
|
22
|
+
const splitSource = (expression) => {
|
|
23
|
+
let depth = 0;
|
|
24
|
+
let quote = '';
|
|
25
|
+
for (let i = 0; i < expression.length; i++) {
|
|
26
|
+
const c = expression[i];
|
|
27
|
+
if (quote) {
|
|
28
|
+
if (c === quote)
|
|
29
|
+
quote = '';
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (c === "'" || c === '"')
|
|
33
|
+
quote = c;
|
|
34
|
+
else if ('[(<{'.includes(c))
|
|
35
|
+
depth++;
|
|
36
|
+
else if ('])>}'.includes(c))
|
|
37
|
+
depth = Math.max(0, depth - 1);
|
|
38
|
+
else if (c === '|' && depth === 0) {
|
|
39
|
+
const source = expression.slice(0, i).trim();
|
|
40
|
+
return { source: source || undefined, selection: expression.slice(i + 1).trim() };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const trimmed = expression.trim();
|
|
44
|
+
// a source with no selection after it brings in the whole document
|
|
45
|
+
return /^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(trimmed) ? { source: trimmed, selection: '' } : { selection: trimmed };
|
|
46
|
+
};
|
|
47
|
+
exports.splitSource = splitSource;
|
|
48
|
+
const TEST_LINE = /^[ \t]*=(?:(?:begin|for)[ \t]+test|test)(?![a-zA-Z0-9_-])/;
|
|
49
|
+
// A test the grammar could not close stays as the line of its directive.
|
|
50
|
+
const isBrokenTest = (node) => isObject(node) &&
|
|
51
|
+
node.type === 'para' &&
|
|
52
|
+
node.error === true &&
|
|
53
|
+
typeof node.value === 'string' &&
|
|
54
|
+
TEST_LINE.test(node.value);
|
|
55
|
+
const readSource = (source) => source.kind === 'text'
|
|
56
|
+
? (0, types_1.ok)({ name: source.name, text: source.text, baseDir: source.baseDir })
|
|
57
|
+
: (0, documents_1.readDocument)(source.path);
|
|
58
|
+
const prepare = (source, index, profile, problems) => {
|
|
59
|
+
const label = source.kind === 'file' ? source.path : source.name;
|
|
60
|
+
const read = readSource(source);
|
|
61
|
+
if (read.ok === false) {
|
|
62
|
+
problems.push({ kind: 'unreadable-source', source: label, message: read.error });
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
const prepared = (0, documents_1.prepareDocument)(read.value, { profile });
|
|
66
|
+
if (prepared.ok === false) {
|
|
67
|
+
problems.push({ kind: 'implementation-error', source: label, message: prepared.error });
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
const { errors, warnings } = prepared.value;
|
|
71
|
+
for (const problem of errors)
|
|
72
|
+
problems.push({ kind: 'include', severity: 'error', source: label, problem });
|
|
73
|
+
for (const problem of warnings)
|
|
74
|
+
problems.push({ kind: 'include', severity: 'warning', source: label, problem });
|
|
75
|
+
return { ...prepared.value, index };
|
|
76
|
+
};
|
|
77
|
+
const placeOf = (node, prepared) => {
|
|
78
|
+
const where = prepared.origin.get(node);
|
|
79
|
+
const location = isObject(node) && isLocation(node.location) ? node.location : undefined;
|
|
80
|
+
return { file: where ? prepared.identify(where.file) : prepared.name, location };
|
|
81
|
+
};
|
|
82
|
+
const keyOf = (place) => `${place.file}:${place.location?.start.offset ?? '?'}:${place.location?.end.offset ?? '?'}`;
|
|
83
|
+
// The settings in effect for the blocks of a test: each block by name with its
|
|
84
|
+
// options in a fixed order, a paragraph or code written without a marker too,
|
|
85
|
+
// and the markup codes read in its text, since the settings decide which of
|
|
86
|
+
// them are read. A place it is brought to and what the reading adds to it are
|
|
87
|
+
// no part of them.
|
|
88
|
+
const settingsOf = (node) => {
|
|
89
|
+
const parts = [];
|
|
90
|
+
const visit = (n, holder) => {
|
|
91
|
+
if (Array.isArray(n))
|
|
92
|
+
return n.forEach(child => visit(child, holder));
|
|
93
|
+
if (!isObject(n))
|
|
94
|
+
return;
|
|
95
|
+
const walked = {
|
|
96
|
+
type: typeof n.type === 'string' ? n.type : undefined,
|
|
97
|
+
name: typeof n.name === 'string' ? n.name : undefined,
|
|
98
|
+
};
|
|
99
|
+
const name = (0, schema_1.blockNameOf)(walked, holder);
|
|
100
|
+
if (name !== undefined) {
|
|
101
|
+
const options = (Array.isArray(n.config) ? n.config : [])
|
|
102
|
+
.filter(isObject)
|
|
103
|
+
.map(c => `${String(c.name)}=${String(c.type)}:${JSON.stringify(c.value)}`)
|
|
104
|
+
.sort();
|
|
105
|
+
parts.push(`${name}(${options.join(',')})`);
|
|
106
|
+
}
|
|
107
|
+
if (n.type === 'fcode' && typeof n.name === 'string')
|
|
108
|
+
parts.push(`${n.name}<>`);
|
|
109
|
+
visit(n.content, (0, schema_1.holderInside)(walked, holder));
|
|
110
|
+
};
|
|
111
|
+
visit(node, undefined);
|
|
112
|
+
return parts.join(';');
|
|
113
|
+
};
|
|
114
|
+
// one test is the same written block under the same settings
|
|
115
|
+
const identityOf = (place, node) => `${keyOf(place)}:${settingsOf(node)}`;
|
|
116
|
+
// A node a plugin wraps children in stands for its children: the list around
|
|
117
|
+
// items has no place of its own, and a folded section has the place of its
|
|
118
|
+
// heading alone.
|
|
119
|
+
const located = (node) => isObject(node) && Array.isArray(node.content) && (!isLocation(node.location) || node.name === '_folded_section')
|
|
120
|
+
? node.content.flatMap(located)
|
|
121
|
+
: [node];
|
|
122
|
+
const inRange = (event, location) => event.location.start.offset >= location.start.offset && event.location.end.offset <= location.end.offset;
|
|
123
|
+
// Every block under the test is read in the file it was written in, so a block
|
|
124
|
+
// an include brings in is checked against the lines of its own file.
|
|
125
|
+
const recognitionOf = (block, prepared) => {
|
|
126
|
+
const seen = new Map();
|
|
127
|
+
// blocks that close what they hold: a line opened inside one is not closed after it
|
|
128
|
+
const containers = [];
|
|
129
|
+
const visit = (node) => {
|
|
130
|
+
if (!isObject(node))
|
|
131
|
+
return;
|
|
132
|
+
if (isLocation(node.location)) {
|
|
133
|
+
const { file } = placeOf(node, prepared);
|
|
134
|
+
const inFile = seen.get(file) ?? new Set();
|
|
135
|
+
for (const event of prepared.recognition.get(file) ?? []) {
|
|
136
|
+
if (inRange(event, node.location))
|
|
137
|
+
inFile.add(event);
|
|
138
|
+
}
|
|
139
|
+
seen.set(file, inFile);
|
|
140
|
+
if (node.type === 'block' && node.name !== '_folded_section')
|
|
141
|
+
containers.push({ file, location: node.location });
|
|
142
|
+
}
|
|
143
|
+
childrenOf(node).forEach(visit);
|
|
144
|
+
};
|
|
145
|
+
childrenOf(block).forEach(visit);
|
|
146
|
+
const scopeOf = (event, file) => {
|
|
147
|
+
let best;
|
|
148
|
+
for (const c of containers) {
|
|
149
|
+
if (c.file !== file || !inRange(event, c.location))
|
|
150
|
+
continue;
|
|
151
|
+
if (!best || c.location.end.offset - c.location.start.offset < best.end.offset - best.start.offset) {
|
|
152
|
+
best = c.location;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return `${file}:${best ? best.start.offset : 'test'}`;
|
|
156
|
+
};
|
|
157
|
+
// a closing line pairs with the opening line before it in the same block,
|
|
158
|
+
// whatever blank lines split the text between them
|
|
159
|
+
const broken = [];
|
|
160
|
+
const scopes = new Map();
|
|
161
|
+
for (const [file, events] of seen) {
|
|
162
|
+
for (const event of events) {
|
|
163
|
+
const key = scopeOf(event, file);
|
|
164
|
+
scopes.set(key, [...(scopes.get(key) ?? []), { event, file }]);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
for (const found of scopes.values()) {
|
|
168
|
+
const open = [];
|
|
169
|
+
found.sort((a, b) => a.event.location.start.offset - b.event.location.start.offset);
|
|
170
|
+
for (const one of found) {
|
|
171
|
+
const { event } = one;
|
|
172
|
+
if (event.kind === 'unreadable-directive')
|
|
173
|
+
broken.push(one);
|
|
174
|
+
else if (event.marker === 'begin')
|
|
175
|
+
open.push(event.name);
|
|
176
|
+
else if (event.marker === 'end') {
|
|
177
|
+
const at = open.lastIndexOf(event.name);
|
|
178
|
+
if (at === -1)
|
|
179
|
+
broken.push(one);
|
|
180
|
+
else
|
|
181
|
+
open.splice(at, 1);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
broken.sort((a, b) => a.event.location.start.offset - b.event.location.start.offset);
|
|
186
|
+
// an unknown block is a child of the test only when it stayed text right
|
|
187
|
+
// under the test; inside a table or another block it belongs to that block
|
|
188
|
+
const unknown = [];
|
|
189
|
+
for (const child of childrenOf(block).flatMap(located)) {
|
|
190
|
+
if (!isObject(child) || child.type !== 'para' || !isLocation(child.location))
|
|
191
|
+
continue;
|
|
192
|
+
const { file } = placeOf(child, prepared);
|
|
193
|
+
for (const event of seen.get(file) ?? []) {
|
|
194
|
+
if (event.kind === 'unknown-directive' && event.marker !== 'end' && inRange(event, child.location)) {
|
|
195
|
+
unknown.push({ event, file });
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
unknown.sort((a, b) => a.event.location.start.offset - b.event.location.start.offset);
|
|
200
|
+
return { unknown, broken };
|
|
201
|
+
};
|
|
202
|
+
const shapeOf = (block, prepared, asserts, resources) => {
|
|
203
|
+
const { unknown, broken } = recognitionOf(block, prepared);
|
|
204
|
+
// an unknown block is skipped even when the rest of the test is broken
|
|
205
|
+
const [first] = unknown;
|
|
206
|
+
if (first && first.event.kind === 'unknown-directive') {
|
|
207
|
+
return {
|
|
208
|
+
kind: 'unknown-child',
|
|
209
|
+
name: first.event.name,
|
|
210
|
+
place: { file: first.file, location: first.event.location },
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
const [damage] = broken;
|
|
214
|
+
if (damage) {
|
|
215
|
+
const { event } = damage;
|
|
216
|
+
const message = event.kind === 'unknown-directive'
|
|
217
|
+
? `closing line of a block that is not open: =end ${event.name}`
|
|
218
|
+
: 'a directive line inside the test cannot be read';
|
|
219
|
+
return { kind: 'malformed', message, place: { file: damage.file, location: event.location } };
|
|
220
|
+
}
|
|
221
|
+
const named = new Set();
|
|
222
|
+
for (const r of resources) {
|
|
223
|
+
if (!r.name)
|
|
224
|
+
return { kind: 'invalid', message: 'a resource has no :name', place: r.place };
|
|
225
|
+
const key = (0, resources_1.resourceKey)(r.name);
|
|
226
|
+
if (key === undefined)
|
|
227
|
+
return { kind: 'invalid', message: `a resource name leaves the test: ${r.name}`, place: r.place };
|
|
228
|
+
if (named.has(key))
|
|
229
|
+
return { kind: 'invalid', message: `two resources are named ${r.name}`, place: r.place };
|
|
230
|
+
named.add(key);
|
|
231
|
+
}
|
|
232
|
+
return asserts.length === 0 ? { kind: 'no-assertions' } : { kind: 'runnable' };
|
|
233
|
+
};
|
|
234
|
+
const readTest = (block, prepared) => {
|
|
235
|
+
const place = placeOf(block, prepared);
|
|
236
|
+
const asserts = [];
|
|
237
|
+
const resources = [];
|
|
238
|
+
let fixture;
|
|
239
|
+
let fixtures = 0;
|
|
240
|
+
for (const child of childrenOf(block).flatMap(located)) {
|
|
241
|
+
if (!isBlock(child))
|
|
242
|
+
continue;
|
|
243
|
+
const childPlace = placeOf(child, prepared);
|
|
244
|
+
if (child.name === 'fixture') {
|
|
245
|
+
fixture = { index: fixtures++, body: bodyOf(child), place: childPlace };
|
|
246
|
+
}
|
|
247
|
+
else if (child.name === 'resource') {
|
|
248
|
+
resources.push({ name: stringOption(child, 'name') ?? '', body: bodyOf(child), place: childPlace });
|
|
249
|
+
}
|
|
250
|
+
else if (child.name === 'assert') {
|
|
251
|
+
const expression = bodyOf(child).trim();
|
|
252
|
+
asserts.push({
|
|
253
|
+
index: asserts.length,
|
|
254
|
+
expression,
|
|
255
|
+
absent: option(child, 'absent') === true,
|
|
256
|
+
caption: stringOption(child, 'caption'),
|
|
257
|
+
place: childPlace,
|
|
258
|
+
source: (0, exports.splitSource)(expression).source,
|
|
259
|
+
fixture,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return {
|
|
264
|
+
key: identityOf(place, block),
|
|
265
|
+
id: stringOption(block, 'id'),
|
|
266
|
+
caption: stringOption(block, 'caption'),
|
|
267
|
+
place,
|
|
268
|
+
obtainedFrom: prepared.index,
|
|
269
|
+
shape: shapeOf(block, prepared, asserts, resources),
|
|
270
|
+
asserts,
|
|
271
|
+
resources,
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
const brokenTest = (node, prepared) => {
|
|
275
|
+
const place = placeOf(node, prepared);
|
|
276
|
+
return {
|
|
277
|
+
key: identityOf(place, node),
|
|
278
|
+
place,
|
|
279
|
+
obtainedFrom: prepared.index,
|
|
280
|
+
shape: { kind: 'malformed', message: 'the test is not closed or holds a block that is not', place },
|
|
281
|
+
asserts: [],
|
|
282
|
+
resources: [],
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
// A test met inside another is not a test to obtain, and a test block holds no
|
|
286
|
+
// section of the document around it.
|
|
287
|
+
const findTests = (prepared) => {
|
|
288
|
+
const found = [];
|
|
289
|
+
const visit = (node) => {
|
|
290
|
+
if (Array.isArray(node))
|
|
291
|
+
return node.forEach(visit);
|
|
292
|
+
if (!isObject(node))
|
|
293
|
+
return;
|
|
294
|
+
if (isBlock(node) && node.name === 'test') {
|
|
295
|
+
found.push(readTest(node, prepared));
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
if (isBrokenTest(node)) {
|
|
299
|
+
found.push(brokenTest(node, prepared));
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
childrenOf(node).forEach(visit);
|
|
303
|
+
};
|
|
304
|
+
visit(prepared.tree);
|
|
305
|
+
return found;
|
|
306
|
+
};
|
|
307
|
+
/*
|
|
308
|
+
=begin pod :kind<export>
|
|
309
|
+
|
|
310
|
+
=head2 collectTests
|
|
311
|
+
|
|
312
|
+
Reads each file of tests the way convert reads a document, includes resolved, and
|
|
313
|
+
finds the tests in it with the file and line each is written at. A test inside
|
|
314
|
+
another, and one inside a code block or a fixture, is not collected. An include that
|
|
315
|
+
could not be resolved is a problem of the collection.
|
|
316
|
+
|
|
317
|
+
=end pod
|
|
318
|
+
*/
|
|
319
|
+
const collectTests = (sources, profile = documents_1.coreProfile) => {
|
|
320
|
+
const problems = [];
|
|
321
|
+
const prepared = [];
|
|
322
|
+
sources.forEach((source, index) => {
|
|
323
|
+
const one = prepare(source, index, profile, problems);
|
|
324
|
+
if (one)
|
|
325
|
+
prepared.push(one);
|
|
326
|
+
});
|
|
327
|
+
return { sources: prepared, tests: prepared.flatMap(findTests), problems };
|
|
328
|
+
};
|
|
329
|
+
exports.collectTests = collectTests;
|
|
330
|
+
// Obtained twice, a test runs once only when every assertion reads a fixture or
|
|
331
|
+
// a source it names each time; one that reads the document around it runs
|
|
332
|
+
// where it was obtained, one that reads a supplied document runs per document.
|
|
333
|
+
/*
|
|
334
|
+
=begin pod :kind<export>
|
|
335
|
+
|
|
336
|
+
=head2 planRuns
|
|
337
|
+
|
|
338
|
+
Decides how often each collected test runs. A test obtained from several files runs
|
|
339
|
+
once when all its assertions read a fixture or a source they name; one that reads the
|
|
340
|
+
document around it runs where it was obtained; one that reads a supplied document
|
|
341
|
+
runs once per document.
|
|
342
|
+
|
|
343
|
+
=end pod
|
|
344
|
+
*/
|
|
345
|
+
const planRuns = (tests, supplied) => {
|
|
346
|
+
const groups = new Map();
|
|
347
|
+
for (const test of tests) {
|
|
348
|
+
const group = groups.get(test.key);
|
|
349
|
+
if (group)
|
|
350
|
+
group.push(test);
|
|
351
|
+
else
|
|
352
|
+
groups.set(test.key, [test]);
|
|
353
|
+
}
|
|
354
|
+
const runs = [];
|
|
355
|
+
for (const obtained of groups.values()) {
|
|
356
|
+
const [test] = obtained;
|
|
357
|
+
const unnamed = test.shape.kind === 'runnable' ? test.asserts.filter(a => a.source === undefined) : [];
|
|
358
|
+
if (supplied > 0 && unnamed.length > 0) {
|
|
359
|
+
for (let document = 0; document < supplied; document++) {
|
|
360
|
+
runs.push({ test, obtained, context: { kind: 'supplied', document } });
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
else if (supplied === 0 && unnamed.some(a => a.fixture === undefined)) {
|
|
364
|
+
for (const one of obtained)
|
|
365
|
+
runs.push({ test: one, obtained: [one], context: { kind: 'containing', source: one.obtainedFrom } });
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
runs.push({ test, obtained, context: { kind: 'fixture-or-named' } });
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return runs;
|
|
372
|
+
};
|
|
373
|
+
exports.planRuns = planRuns;
|
|
374
|
+
//# sourceMappingURL=collect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collect.js","sourceRoot":"","sources":["../../src/test/collect.ts"],"names":[],"mappings":";;;AACA,4CAA2D;AAC3D,2CAAwE;AAExE,2CAAyC;AAazC,mCAA4B;AAoB5B,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAA;AAElH,MAAM,OAAO,GAAG,CAAC,KAAc,EAAkB,EAAE,CACjD,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAA;AAE7E,MAAM,UAAU,GAAG,CAAC,KAAc,EAAqB,EAAE,CACvD,QAAQ,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,OA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