-
Notifications
You must be signed in to change notification settings - Fork 45
/
meta.wlt
42 lines (37 loc) · 1.37 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
<|
"meta" -> <|
"init" -> (
$testsDirectory = If[$TestFileName =!= "",
FileNameJoin[Most @ FileNameSplit @ $TestFileName],
FileNameJoin[Append[Most[FileNameSplit[$ScriptCommandLine[[1]]]], "Tests"]]
];
),
"tests" -> {
exports = Lookup[Package`PackageInformation["SetReplace`"], "PackageExports"];
(* All public symbols have usage message *)
hasNoSymbolUsageQ = Function[symbol,
Not @ StringQ @ MessageName[symbol, "usage"], HoldFirst];
VerificationTest[
Select[exports, hasNoSymbolUsageQ], HoldComplete[]
],
(* All public symbols have syntax information *)
hasNoSyntaxInformationQ = Function[symbol, Not[
StringStartsQ[SymbolName @ Unevaluated @ symbol, "$"] ||
SyntaxInformation[Unevaluated @ symbol] =!= {}], HoldFirst];
VerificationTest[
Select[exports, hasNoSyntaxInformationQ], HoldComplete[]
],
(* Test coverage: all public symbols appear in unit tests *)
allSource = StringJoin[FileString /@ FileNames["*.wlt", $testsDirectory]];
doesNotAppearInSourceQ = Function[symbol,
!StringContainsQ[allSource, SymbolName @ Unevaluated @ symbol],
HoldFirst];
VerificationTest[
Select[exports, doesNotAppearInSourceQ], HoldComplete[]
]
},
"options" -> {
"Parallel" -> False
}
|>
|>