]> code.delx.au - gnu-emacs-elpa/blobdiff - tests/indent.el
Make a new release
[gnu-emacs-elpa] / tests / indent.el
index b0235fffc15c40d0e73a52f31c39ca9440cbb306..0fabe95637e1686894560ab70bec1b9e86e898ac 100644 (file)
@@ -1,6 +1,6 @@
 ;;; tests/indent.el --- Some tests for js2-mode.
 
-;; Copyright (C) 2009, 2011-2013  Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2011-2016  Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -32,6 +32,7 @@
            s
          (replace-regexp-in-string "^ *" "" s)))
       (js2-jsx-mode)
+      (js2-reparse) ; solely for js2-jsx-self-closing, for some reason
       (indent-region (point-min) (point-max))
       (should (string= s (buffer-substring-no-properties
                           (point-min) (point)))))))
   |}"
   :bind ((js2-indent-switch-body t)))
 
+(js2-deftest-indent continued-expression-vs-unary-minus
+  "var arr = [
+  |  -1, 2,
+  |  -3, 4 +
+  |    -5
+  |];")
+
+(js2-deftest-indent spread-inside-array
+  "var z = [
+  |  ...iterableObj,
+  |  4,
+  |  5
+  |]")
+
 (js2-deftest-indent jsx-one-line
   "var foo = <div></div>;")