Skip to content

Commit

Permalink
test single file
Browse files Browse the repository at this point in the history
  • Loading branch information
aspeddro committed Dec 21, 2024
1 parent 70ef72e commit e482294
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
9 changes: 8 additions & 1 deletion tests/docstrings_examples/DocTest.res
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ let runtimeTests = async code => {
},
)

Console.log({
"code": code,
"exitCode": exitCode,
"stdout": stdout,
"stderr": stderr,
})

// Some expressions, like, `console.error("error")` is printed to stderr but
// exit code is 0
let std = switch exitCode->Null.toOption {
Expand Down Expand Up @@ -308,7 +315,7 @@ let main = async () => {
// Ignore Js modules and RescriptTools for now
->Array.filter(f => !String.startsWith(f, "Js") && !String.startsWith(f, "RescriptTools"))
->Array.filter(f => f->String.endsWith(".res") || f->String.endsWith(".resi"))
// ->Array.filter(f => f === "String.resi")
->Array.filter(f => f === "Uint8ClampedArray.res")
->Array.reduce([], (acc, cur) => {
let isInterface = cur->String.endsWith(".resi")

Expand Down
10 changes: 8 additions & 2 deletions tests/docstrings_examples/DocTest.res.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ async function runtimeTests(code) {
let exitCode = match.code;
let stderr = match.stderr;
let stdout = match.stdout;
console.log({
code: code,
exitCode: exitCode,
stdout: stdout,
stderr: stderr
});
let std;
let exit = 0;
if (exitCode !== null) {
Expand Down Expand Up @@ -183,7 +189,7 @@ function extractDocFromFile(file) {
RE_EXN_ID: "Assert_failure",
_1: [
"DocTest.res",
199,
206,
9
],
Error: new Error()
Expand Down Expand Up @@ -351,7 +357,7 @@ async function main() {
} else {
return f.endsWith(".resi");
}
}), [], (acc, cur) => {
}).filter(f => f === "Uint8ClampedArray.res"), [], (acc, cur) => {
let isInterface = cur.endsWith(".resi");
let resi = Path.join("runtime", cur + "i");
if (!isInterface && Fs.existsSync(resi)) {
Expand Down

0 comments on commit e482294

Please sign in to comment.