[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 27e9bce 03/28: Add new (failing) unclosed JSX test
From: |
Jackson Ray Hamilton |
Subject: |
[Emacs-diffs] master 27e9bce 03/28: Add new (failing) unclosed JSX test and separate such tests |
Date: |
Tue, 9 Apr 2019 02:00:11 -0400 (EDT) |
branch: master
commit 27e9bce77db54464737aa5be1ce7142b55f25952
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Add new (failing) unclosed JSX test and separate such tests
* test/manual/indent/js-jsx.js: Move test with intentional scan error to
its own file, js-jsx-unclosed-1.js.
* test/manual/indent/js-jsx-unclosed-1.js: New file.
* test/manual/indent/js-jsx-unclosed-2.js: New file with test for
regression caused by new ambiguous parsing of JS/JSX.
---
test/manual/indent/js-jsx-unclosed-1.js | 15 +++++++++++++++
test/manual/indent/js-jsx-unclosed-2.js | 17 +++++++++++++++++
test/manual/indent/js-jsx.js | 9 ---------
3 files changed, 32 insertions(+), 9 deletions(-)
diff --git a/test/manual/indent/js-jsx-unclosed-1.js
b/test/manual/indent/js-jsx-unclosed-1.js
new file mode 100644
index 0000000..9418aed
--- /dev/null
+++ b/test/manual/indent/js-jsx-unclosed-1.js
@@ -0,0 +1,15 @@
+// -*- mode: js-jsx; -*-
+
+// Local Variables:
+// indent-tabs-mode: nil
+// js-indent-level: 2
+// End:
+
+// The following test goes below any comments to avoid including
+// misindented comments among the erroring lines.
+
+return (
+ <div>
+ {array.map(function () {
+ return {
+ a: 1
diff --git a/test/manual/indent/js-jsx-unclosed-2.js
b/test/manual/indent/js-jsx-unclosed-2.js
new file mode 100644
index 0000000..2d42cf7
--- /dev/null
+++ b/test/manual/indent/js-jsx-unclosed-2.js
@@ -0,0 +1,17 @@
+// -*- mode: js-jsx; -*-
+
+// Local Variables:
+// indent-tabs-mode: nil
+// js-indent-level: 2
+// End:
+
+// The following tests go below any comments to avoid including
+// misindented comments among the erroring lines.
+
+// Don’t misinterpret equality operators as JSX.
+for (; i < length;) void 0
+if (foo > bar) void 0
+
+// Don’t even misinterpret unary operators as JSX.
+if (foo < await bar) void 0
+while (await foo > bar) void 0
diff --git a/test/manual/indent/js-jsx.js b/test/manual/indent/js-jsx.js
index 35ca4b2..af3c340 100644
--- a/test/manual/indent/js-jsx.js
+++ b/test/manual/indent/js-jsx.js
@@ -257,12 +257,3 @@ return (
// indent-tabs-mode: nil
// js-indent-level: 2
// End:
-
-// The following test has intentionally unclosed elements and should
-// be placed below all other tests to prevent awkward indentation.
-
-return (
- <div>
- {array.map(function () {
- return {
- a: 1
- [Emacs-diffs] master updated (e1872f8 -> cf416d9), Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 27e9bce 03/28: Add new (failing) unclosed JSX test and separate such tests,
Jackson Ray Hamilton <=
- [Emacs-diffs] master 2bedd23 09/28: Update expectations for JSX indentation in JSXAttribute space, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 16669d7 16/28: Fix counting of nested self-closing JSXOpeningElements, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 52a3113 06/28: Add basic JSX font-locking, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 339be7c 11/28: Finish replacing SGML-based JSX detection with js-mode’s parsing, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 8dae742 08/28: Propertize and font-lock JSXText and JSXExpressionContainers, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 3eadf1e 24/28: Identify JSX strings (for js2-mode), Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 4b305bb 02/28: Refactor JSX indentation code to improve enclosing JSX discovery, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 58c77f1 01/28: Add failing tests for JSX indentation bugs, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 4d2b5bb 07/28: Font-lock JSX while editing it by extending regions, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 462baab 19/28: Add tests for miscellaneous JSX parsing feats, Jackson Ray Hamilton, 2019/04/09