aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2014-11-14 17:25:27 -0500
committerSean Allred <code@seanallred.com>2014-11-14 17:30:21 -0500
commit1e859ea6d9b5365f69f8dea5d690e6bee8350e7a (patch)
tree7f7da64a833f8c1c783b6d4977fc79f06d227d1d /test
parent403c021d92bb036be5d95735bc1403056db3780b (diff)
parent22cc1b1b959761cda2ff2048dbaeba99cc094930 (diff)
Merge branch 'master' into network-list
Conflicts: sx-filter.el sx-question.el
Diffstat (limited to 'test')
-rw-r--r--test/tests.el32
1 files changed, 24 insertions, 8 deletions
diff --git a/test/tests.el b/test/tests.el
index a66394c..6a48257 100644
--- a/test/tests.el
+++ b/test/tests.el
@@ -20,6 +20,14 @@
(insert-file-contents file)
(read (buffer-string))))))
+(defmacro line-should-match (regexp)
+ ""
+ `(let ((line (buffer-substring-no-properties
+ (line-beginning-position)
+ (line-end-position))))
+ (message "Line here is: %S" line)
+ (should (string-match ,regexp line))))
+
(setq
sx-request-remaining-api-requests-message-threshold 50000
debug-on-error t
@@ -89,14 +97,6 @@
((1 . alpha) (2 . beta))]
'(1 2 3)))))
-(defmacro line-should-match (regexp)
- ""
- `(let ((line (buffer-substring-no-properties
- (line-beginning-position)
- (line-end-position))))
- (message "Line here is: %S" line)
- (should (string-match ,regexp line))))
-
(ert-deftest question-list-display ()
(cl-letf (((symbol-function #'sx-request-make)
(lambda (&rest _) sx-test-data-questions)))
@@ -116,3 +116,19 @@
(sx-question-list-previous 4)
(line-should-match
"^\\s-+2\\s-+1\\s-+&quot;Making tag completion table&quot; Freezes/Blocks -- how to disable [ 0-9]+[ydhms] ago\\s-+\\[autocomplete\\]")))
+
+(ert-deftest macro-test--sx-assoc-let ()
+ "Tests macro expansion for `sx-assoc-let'"
+ (should
+ (equal '(let ((.test (cdr (assoc 'test data))))
+ .test)
+ (macroexpand
+ '(sx-assoc-let data
+ .test))))
+ (should
+ (equal '(let ((.test-one (cdr (assoc 'test-one data)))
+ (.test-two (cdr (assoc 'test-two data))))
+ (cons .test-one .test-two))
+ (macroexpand
+ '(sx-assoc-let data
+ (cons .test-one .test-two))))))