From e132d9066dd1d7acede428438ba8a32345ac343f Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Wed, 26 Dec 2018 09:00:55 -0700 Subject: 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. --- src/tools/rustdoc-js/tester.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/tools/rustdoc-js') 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; } -- cgit 1.4.1-3-g733a5