Skip to content

Commit c5d536a

Browse files
committed
only include code blocks with tests in them
1 parent 2936a9f commit c5d536a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/docstring_tests/DocTest.res

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ let extractExamples = async () => {
8282
await docFiles->ArrayUtils.forEachAsyncInBatches(~batchSize, async f => {
8383
let doc = await extractDocFromFile(Path.join(["runtime", f]))
8484
switch doc {
85-
| Ok(doc) => examples->Array.pushMany(doc)
85+
| Ok(doc) =>
86+
// TODO: Should this be a flag in the actual command instead, to only include code blocks with tests?
87+
examples->Array.pushMany(doc->Array.filter(d => d.code->String.includes("assertEqual(")))
8688
| Error(e) => Console.error(e)
8789
}
8890
})

tests/docstring_tests/DocTest.res.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)