Skip to content

Commit 96d4f25

Browse files
committed
more log
1 parent e0cb34f commit 96d4f25

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

tests/docstrings_examples/DocTest.res

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,22 @@ type example = {
124124
let createFileInTempDir = id => Path.join2(OS.tmpdir(), id)
125125

126126
let compileTest = async (~id, ~code) => {
127+
Console.log({"id": id, "code": code})
127128
let {stderr, stdout} = await SpawnAsync.run(
128129
~command=bscBin,
129130
// NOTE: warnings argument (-w) should be before eval (-e) argument
130131
~args=["-w", "-3-109-44", "-e", code],
131132
)
132133

133-
Console.log({"id": id, "code": code, "stderr": stderr, "stdout": stdout})
134+
Console.log({
135+
"id": id,
136+
"stderr": stderr
137+
->Array.map(e => e->Buffer.toString)
138+
->Array.join(""),
139+
"stdout": stdout
140+
->Array.map(e => e->Buffer.toString)
141+
->Array.join(""),
142+
})
134143

135144
switch Array.length(stderr) > 0 {
136145
| true =>

tests/docstrings_examples/DocTest.res.mjs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ function createFileInTempDir(id) {
9494
}
9595

9696
async function compileTest(id, code) {
97+
console.log({
98+
id: id,
99+
code: code
100+
});
97101
let match = await run(bscBin, [
98102
"-w",
99103
"-3-109-44",
@@ -104,9 +108,8 @@ async function compileTest(id, code) {
104108
let stdout = match.stdout;
105109
console.log({
106110
id: id,
107-
code: code,
108-
stderr: stderr,
109-
stdout: stdout
111+
stderr: stderr.map(e => e.toString()).join(""),
112+
stdout: stdout.map(e => e.toString()).join("")
110113
});
111114
if (stderr.length > 0) {
112115
return {
@@ -199,7 +202,7 @@ function extractDocFromFile(file) {
199202
RE_EXN_ID: "Assert_failure",
200203
_1: [
201204
"DocTest.res",
202-
208,
205+
217,
203206
9
204207
],
205208
Error: new Error()

0 commit comments

Comments
 (0)