X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/7c12f2cf73cbbe39deab169a7e541e46a298e6a9..0cda39255827f283e7578cd469ae42daad9556a2:/tests/indent.el diff --git a/tests/indent.el b/tests/indent.el index bacb61485..0fabe9563 100644 --- a/tests/indent.el +++ b/tests/indent.el @@ -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))))))) @@ -146,7 +147,15 @@ "class A { | * x() { | return 1 - | * 2; + | * a(2); + | } + |}") + +(js2-deftest-indent indent-generator-computed-method + "class A { + | *[Symbol.iterator]() { + | yield 'Foo'; + | yield 'Bar'; | } |}") @@ -171,6 +180,20 @@ |}" :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 =
;")