diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2018-12-26 09:00:55 -0700 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2018-12-26 09:00:55 -0700 |
| commit | e132d9066dd1d7acede428438ba8a32345ac343f (patch) | |
| tree | 9937976e72116b7deb2035e6a251472168f1ad64 /src/tools/rustdoc-js/tester.js | |
| parent | 2a663555ddf36f6b041445894a8c175cd1bc718c (diff) | |
| download | rust-e132d9066dd1d7acede428438ba8a32345ac343f.tar.gz rust-e132d9066dd1d7acede428438ba8a32345ac343f.zip | |
Account for no newline before test annotations
Previously the license comment would always provide that newline but since that's been removed this change is needed.
Diffstat (limited to 'src/tools/rustdoc-js/tester.js')
| -rw-r--r-- | src/tools/rustdoc-js/tester.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tools/rustdoc-js/tester.js b/src/tools/rustdoc-js/tester.js index 94c4078f911..c41da93a983 100644 --- a/src/tools/rustdoc-js/tester.js +++ b/src/tools/rustdoc-js/tester.js @@ -164,9 +164,12 @@ function loadContent(content) { var Module = module.constructor; var m = new Module(); m._compile(content, "tmp.js"); - m.exports.ignore_order = content.indexOf("\n// ignore-order\n") !== -1; - m.exports.exact_check = content.indexOf("\n// exact-check\n") !== -1; - m.exports.should_fail = content.indexOf("\n// should-fail\n") !== -1; + m.exports.ignore_order = content.indexOf("\n// ignore-order\n") !== -1 || + content.startsWith("// ignore-order\n"); + m.exports.exact_check = content.indexOf("\n// exact-check\n") !== -1 || + content.startsWith("// exact-check\n"); + m.exports.should_fail = content.indexOf("\n// should-fail\n") !== -1 || + content.startsWith("// should-fail\n"); return m.exports; } |
