Skip to content

Commit 6b0b654

Browse files
Update rustdoc-js test tool
1 parent 4e560d7 commit 6b0b654

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/tools/rustdoc-js/tester.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,20 @@ function valueCheck(fullPath, expected, result, error_text, queryName) {
138138
error_text.push('==> Unknown key "' + key + '"');
139139
break;
140140
}
141+
let result_v = result[key];
142+
if (result_v !== null && key === "error") {
143+
result_v.forEach((value, index) => {
144+
value = value.split(" ").join(" ");
145+
if (index % 2 === 1) {
146+
result_v[index] = "`" + value + "`";
147+
} else {
148+
result_v[index] = value;
149+
}
150+
});
151+
result_v = result_v.join("");
152+
}
141153
const obj_path = fullPath + (fullPath.length > 0 ? '.' : '') + key;
142-
valueCheck(obj_path, expected[key], result[key], error_text, queryName);
154+
valueCheck(obj_path, expected[key], result_v, error_text, queryName);
143155
}
144156
} else {
145157
expectedValue = JSON.stringify(expected);

0 commit comments

Comments
 (0)