aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorStephen Leake2014-12-24 07:42:40 -0600
committerStephen Leake2014-12-24 07:42:40 -0600
commitf3be0025481f15717198befe557208614e513e92 (patch)
treec514ddea4da4b688c92d12f557f471c4edd1e990 /test
parentb4161ac70e4206cc00263e0c1f765b4cf95dfd33 (diff)
parent882370eaa4f7ad6a88396dfdc64f896c727f87f4 (diff)
downloademacs-f3be0025481f15717198befe557208614e513e92.tar.gz
emacs-f3be0025481f15717198befe557208614e513e92.zip
resolve ChangeLog merge conflict
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog1
-rw-r--r--test/automated/let-alist.el28
-rw-r--r--test/indent/js.js5
3 files changed, 32 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 80d2a40bc4c..7d23b3efe1c 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,6 +1,7 @@
12014-12-19 Artur Malabarba <bruce.connor.am@gmail.com> 12014-12-19 Artur Malabarba <bruce.connor.am@gmail.com>
2 2
3 * automated/let-alist.el: require `cl-lib' 3 * automated/let-alist.el: require `cl-lib'
4 New tests for accessing alists inside alists.
4 5
52014-12-18 Artur Malabarba <bruce.connor.am@gmail.com> 62014-12-18 Artur Malabarba <bruce.connor.am@gmail.com>
6 7
diff --git a/test/automated/let-alist.el b/test/automated/let-alist.el
index a700a4773ff..c43e6a07ddc 100644
--- a/test/automated/let-alist.el
+++ b/test/automated/let-alist.el
@@ -30,10 +30,22 @@
30 (.test-two (cdr (assq 'test-two symbol)))) 30 (.test-two (cdr (assq 'test-two symbol))))
31 (list .test-one .test-two 31 (list .test-one .test-two
32 .test-two .test-two))) 32 .test-two .test-two)))
33 (cl-letf (((symbol-function #'gensym) (lambda (x) 'symbol))) 33 (cl-letf (((symbol-function #'make-symbol) (lambda (x) 'symbol)))
34 (macroexpand 34 (macroexpand
35 '(let-alist data (list .test-one .test-two 35 '(let-alist data (list .test-one .test-two
36 .test-two .test-two))))))) 36 .test-two .test-two))))))
37 (should
38 (equal
39 (let ((.external "ext")
40 (.external.too "et"))
41 (let-alist '((test-two . 0)
42 (test-three . 1)
43 (sublist . ((foo . 2)
44 (bar . 3))))
45 (list .test-one .test-two .test-three
46 .sublist.foo .sublist.bar
47 ..external ..external.too)))
48 (list nil 0 1 2 3 "ext" "et"))))
37 49
38(defvar let-alist--test-counter 0 50(defvar let-alist--test-counter 0
39 "Used to count number of times a function is called.") 51 "Used to count number of times a function is called.")
@@ -49,5 +61,17 @@
49 (list .test-one .test-two .test-two .test-three .cl-incf)) 61 (list .test-one .test-two .test-two .test-three .cl-incf))
50 '(nil 1 1 2 nil))))) 62 '(nil 1 1 2 nil)))))
51 63
64(ert-deftest let-alist-remove-dot ()
65 "Remove firt dot from symbol."
66 (should (equal (let-alist--remove-dot 'hi) 'hi))
67 (should (equal (let-alist--remove-dot '.hi) 'hi))
68 (should (equal (let-alist--remove-dot '..hi) '.hi)))
69
70(ert-deftest let-alist-list-to-sexp ()
71 "Check that multiple dots are handled correctly."
72 (should (= 1 (eval (let-alist--list-to-sexp '(a b c d) ''((d (c (b (a . 1)))))))))
73 (should (equal (let-alist--access-sexp '.foo.bar.baz 'var)
74 '(cdr (assq 'baz (cdr (assq 'bar (cdr (assq 'foo var))))))))
75 (should (equal (let-alist--access-sexp '..foo.bar.baz 'var) '.foo.bar.baz)))
52 76
53;;; let-alist.el ends here 77;;; let-alist.el ends here
diff --git a/test/indent/js.js b/test/indent/js.js
index 1924094e9d8..2d458e1b769 100644
--- a/test/indent/js.js
+++ b/test/indent/js.js
@@ -7,6 +7,11 @@ let c = 1,
7var e = 100500, 7var e = 100500,
8 + 1; 8 + 1;
9 9
10function test ()
11{
12 return /[/]/.test ('/') // (bug#19397)
13}
14
10var f = bar('/protocols/') 15var f = bar('/protocols/')
11baz(); 16baz();
12 17