emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 66d69cb 39/45: js2-test-parse-string: Compare the first sy


From: Dmitry Gutov
Subject: [elpa] master 66d69cb 39/45: js2-test-parse-string: Compare the first syntax error
Date: Mon, 02 Feb 2015 03:18:49 +0000

branch: master
commit 66d69cb888f7b2fbd096f288aebe852d51a97130
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    js2-test-parse-string: Compare the first syntax error
---
 tests/parser.el |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/parser.el b/tests/parser.el
index 553200e..b4f2d8f 100644
--- a/tests/parser.el
+++ b/tests/parser.el
@@ -48,7 +48,7 @@
       (if syntax-error
           (let ((errors (js2-ast-root-errors ast)))
             (should (= (or errors-count 1) (length errors)))
-            (cl-destructuring-bind (_ pos len) (cl-first errors)
+            (cl-destructuring-bind (_ pos len) (car (last errors))
               (should (string= syntax-error (substring code-string
                                                        (1- pos) (+ pos len 
-1))))))
         (should (= 0 (length (js2-ast-root-errors ast))))
@@ -184,7 +184,7 @@ the test."
   "var x = {a: 1, b, c: 1, d};")
 
 (js2-deftest-parse object-literal-shorthard-with-number
-  "var a = {1};" :syntax-error ";" :errors-count 2)
+  "var a = {1};" :syntax-error "}" :errors-count 2)
 
 (js2-deftest-parse object-literal-method
   "var x = {f(y) {  return y;\n}};")
@@ -255,13 +255,13 @@ the test."
   "([{a}, b]) => {  a + b;\n};")
 
 (js2-deftest-parse parenless-arrow-function-prohibits-rest
-  "...b => {b + 1;};" :syntax-error "=>" :errors-count 1)
+  "...b => {b + 1;};" :syntax-error "=>")
 
 (js2-deftest-parse parenless-arrow-function-prohibits-destructuring
-  "[a, b] => {a + b;};" :syntax-error "=>" :errors-count 4)
+  "[a, b] => {a + b;};" :syntax-error "]" :errors-count 4)
 
 (js2-deftest-parse arrow-function-recovers-from-error
-  "[(,foo) => 1];" :syntax-error "=>" :errors-count 6)
+  "[(,foo) => 1];" :syntax-error "," :errors-count 6)
 
 ;;; Automatic semicolon insertion
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]