Update rustdoc-js test tool
This commit is contained in:
parent
4e560d7d0b
commit
6b0b65424a
1 changed files with 13 additions and 1 deletions
|
@ -138,8 +138,20 @@ function valueCheck(fullPath, expected, result, error_text, queryName) {
|
||||||
error_text.push('==> Unknown key "' + key + '"');
|
error_text.push('==> Unknown key "' + key + '"');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
let result_v = result[key];
|
||||||
|
if (result_v !== null && key === "error") {
|
||||||
|
result_v.forEach((value, index) => {
|
||||||
|
value = value.split(" ").join(" ");
|
||||||
|
if (index % 2 === 1) {
|
||||||
|
result_v[index] = "`" + value + "`";
|
||||||
|
} else {
|
||||||
|
result_v[index] = value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
result_v = result_v.join("");
|
||||||
|
}
|
||||||
const obj_path = fullPath + (fullPath.length > 0 ? '.' : '') + key;
|
const obj_path = fullPath + (fullPath.length > 0 ? '.' : '') + key;
|
||||||
valueCheck(obj_path, expected[key], result[key], error_text, queryName);
|
valueCheck(obj_path, expected[key], result_v, error_text, queryName);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
expectedValue = JSON.stringify(expected);
|
expectedValue = JSON.stringify(expected);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue