aboutsummaryrefslogtreecommitdiff
path: root/test/test-macros.el
blob: 6a1910c194dea5a8ba413cb6f60005d542069792 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(ert-deftest macro-test--sx-assoc-let ()
  "Tests macro expansion for `sx-assoc-let'"
  (let ((prototype '((test . nil) (test-one . 1) (test-two . 2)
                     (link . "http://meta.emacs.stackexchange.com/"))))
    (let ((data (copy-tree prototype)))
      (should
       (null (let-alist data .site))))

    (let ((data (copy-tree prototype)))
      (should
       (equal (sx-assoc-let data .site)
              "meta.emacs")))

    (let ((data (copy-tree prototype)))
      (should
       (equal (sx-assoc-let data (cons .test-one .test-two))
              '(1 . 2))))))