Skip to content

Commit e0cb34f

Browse files
committed
debug on compile
1 parent 8fcef6c commit e0cb34f

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

tests/docstrings_examples/DocTest.res

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,15 @@ type example = {
123123

124124
let createFileInTempDir = id => Path.join2(OS.tmpdir(), id)
125125

126-
let compileTest = async (~id as _, ~code) => {
126+
let compileTest = async (~id, ~code) => {
127127
let {stderr, stdout} = await SpawnAsync.run(
128128
~command=bscBin,
129129
// NOTE: warnings argument (-w) should be before eval (-e) argument
130130
~args=["-w", "-3-109-44", "-e", code],
131131
)
132132

133+
Console.log({"id": id, "code": code, "stderr": stderr, "stdout": stdout})
134+
133135
switch Array.length(stderr) > 0 {
134136
| true =>
135137
stderr

tests/docstrings_examples/DocTest.res.mjs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,21 @@ function createFileInTempDir(id) {
9393
return Path.join(Os.tmpdir(), id);
9494
}
9595

96-
async function compileTest(param, code) {
96+
async function compileTest(id, code) {
9797
let match = await run(bscBin, [
9898
"-w",
9999
"-3-109-44",
100100
"-e",
101101
code
102102
], undefined);
103103
let stderr = match.stderr;
104+
let stdout = match.stdout;
105+
console.log({
106+
id: id,
107+
code: code,
108+
stderr: stderr,
109+
stdout: stdout
110+
});
104111
if (stderr.length > 0) {
105112
return {
106113
TAG: "Error",
@@ -109,7 +116,7 @@ async function compileTest(param, code) {
109116
} else {
110117
return {
111118
TAG: "Ok",
112-
_0: match.stdout.map(e => e.toString()).join("")
119+
_0: stdout.map(e => e.toString()).join("")
113120
};
114121
}
115122
}
@@ -192,7 +199,7 @@ function extractDocFromFile(file) {
192199
RE_EXN_ID: "Assert_failure",
193200
_1: [
194201
"DocTest.res",
195-
206,
202+
208,
196203
9
197204
],
198205
Error: new Error()

0 commit comments

Comments
 (0)