forked from maxitg/SetReplace
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmeta.wlt
49 lines (44 loc) · 1.51 KB
/
meta.wlt
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
<|
"meta" -> <|
"init" -> (
$testsDirectory = If[$TestFileName =!= "",
FileNameJoin[Most @ FileNameSplit @ $TestFileName],
FileNameJoin[Append[Most[FileNameSplit[$ScriptCommandLine[[1]]]], "Tests"]]
];
),
"tests" -> {
(* All public symbols have usage message *)
VerificationTest[
AllTrue[
ReleaseHold[{Function[symbol, MessageName[symbol, "usage"], HoldFirst] /@
("PackageExports" /. Package`PackageInformation["SetReplace`"])}],
StringQ]
],
(* All public symbols have syntax information *)
VerificationTest[
AllTrue[
ReleaseHold[{Function[
symbol,
{SymbolName[Unevaluated[symbol]], SyntaxInformation[symbol]},
HoldFirst] /@
("PackageExports" /. Package`PackageInformation["SetReplace`"])}],
If[StringStartsQ[#[[1]], "$"], #[[2]] === {}, #[[2]] =!= {}] &]
],
(* Test coverage: all public symbols appear in unit tests *)
With[{testsDirectory = $testsDirectory}, VerificationTest[
AllTrue[
ReleaseHold[{Function[
symbol,
SymbolName[Unevaluated[symbol]],
HoldFirst] /@
("PackageExports" /. Package`PackageInformation["SetReplace`"])}],
StringContainsQ[StringJoin[Import[
FileNameJoin[Append[FileNameSplit @ testsDirectory, "*.wlt"]],
"Text"]], #] &]
]]
},
"options" -> {
"Parallel" -> False
}
|>
|>