journal/tool/tests.jq

28 lines
615 B
Plaintext
Raw Normal View History

2024-11-07 13:10:18 +00:00
import "./testdata/tests_export" as $exportDataArray;
2024-11-07 08:58:38 +00:00
include "journalUtils";
include "testLib";
2024-11-07 11:39:39 +00:00
import "typeLib" as typeLib;
2024-11-07 08:58:38 +00:00
2024-11-07 11:39:39 +00:00
def journalUtilsTests:
2024-11-07 08:58:38 +00:00
expectPassed(runTest(
"invalid input to experienceByTitle";
(
2024-11-07 13:10:18 +00:00
null | experienceByTitle("Test")
2024-11-07 08:58:38 +00:00
);
2024-11-07 09:10:34 +00:00
. == "experienceByTitle takes a array of experiences as input";
true
2024-11-07 13:10:18 +00:00
)) |
expectPassed(runTest(
"experience not found";
(
$exportDataArray[0].experiences | experienceByTitle("Test")
);
. == null;
false
2024-11-07 11:39:39 +00:00
));
def testsMain:
journalUtilsTests |
typeLib::typeLibTests |
"Tests Passed\n" | halt_error(0);