diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-03-01 17:22:49 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-03-02 12:59:04 +0100 |
| commit | 6b0b65424a7bc905ceed071613cbb737ed796491 (patch) | |
| tree | e21958b1086147ce7f30dc635b4de1ea4603687c | |
| parent | 4e560d7d0bdf666a320cf1514c0100cb17acf441 (diff) | |
| download | rust-6b0b65424a7bc905ceed071613cbb737ed796491.tar.gz rust-6b0b65424a7bc905ceed071613cbb737ed796491.zip | |
Update rustdoc-js test tool
| -rw-r--r-- | src/tools/rustdoc-js/tester.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/tools/rustdoc-js/tester.js b/src/tools/rustdoc-js/tester.js index 3da4fed33e1..ea5780f66d7 100644 --- a/src/tools/rustdoc-js/tester.js +++ b/src/tools/rustdoc-js/tester.js @@ -138,8 +138,20 @@ function valueCheck(fullPath, expected, result, error_text, queryName) { error_text.push('==> Unknown key "' + key + '"'); 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; - valueCheck(obj_path, expected[key], result[key], error_text, queryName); + valueCheck(obj_path, expected[key], result_v, error_text, queryName); } } else { expectedValue = JSON.stringify(expected); |
