From c5bcc85d9cb79c080846cb13979938c8be7c0cba Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Thu, 18 Dec 2014 18:49:38 -0200 Subject: Test sx-assoc-let not let-alist Since let-alist is no longer defined here. It makes no sense to test its contents. --- test/tests.el | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'test') diff --git a/test/tests.el b/test/tests.el index 8969c37..66d8d88 100644 --- a/test/tests.el +++ b/test/tests.el @@ -123,20 +123,14 @@ (should (equal '(progn (require 'let-alist) (sx--ensure-site data) - (let ((.test (cdr (assq 'test data)))) - .test)) - (macroexpand-all - '(sx-assoc-let data - .test)))) + (let-alist data .test)) + (macroexpand '(sx-assoc-let data .test)))) (should (equal '(progn (require 'let-alist) (sx--ensure-site data) - (let ((.test-one (cdr (assq 'test-one data))) - (.test-two (cdr (assq 'test-two data)))) - (cons .test-one .test-two))) - (macroexpand-all - '(sx-assoc-let data - (cons .test-one .test-two)))))) + (let-alist data (cons .test-one .test-two))) + (macroexpand + '(sx-assoc-let data (cons .test-one .test-two)))))) (ert-deftest sx--user-@name () "Tests macro expansion for `sx-assoc-let'" -- cgit v1.2.3 From 04ffa4b891161ce98fa203812768f06808417e0d Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sun, 21 Dec 2014 10:34:21 -0200 Subject: Data sample --- test/data-samples/inbox-item.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/data-samples/inbox-item.el (limited to 'test') diff --git a/test/data-samples/inbox-item.el b/test/data-samples/inbox-item.el new file mode 100644 index 0000000..faeba12 --- /dev/null +++ b/test/data-samples/inbox-item.el @@ -0,0 +1,13 @@ +((title . "Can I mark inbox items as read in api v2.2?") + (link . "http://stackapps.com/posts/comments/12080?noredirect=1") + (item_type . "comment") + (question_id . 5059) + (comment_id . 12080) + (creation_date . 1419153905) + (is_unread . :json-false) + (site (site_type . "main_site") + (name . "Stack Apps") + (api_site_parameter . "stackapps") + (site_url . "http://stackapps.com") + (favicon_url . "http://cdn.sstatic.net/stackapps/img/favicon.ico") + (styling (link_color . "#0077DD") (tag_foreground_color . "#555555") (tag_background_color . "#E7ECEC")))) -- cgit v1.2.3 From a11be51a7aa5ea26e3d55383d328a0624b924125 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Fri, 2 Jan 2015 12:02:27 -0500 Subject: Use .site_par in tests In accordance with d51791fb6ae69e3b426f7d598920b4349858908f --- test/test-macros.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/test-macros.el b/test/test-macros.el index 2169088..b6bf20b 100644 --- a/test/test-macros.el +++ b/test/test-macros.el @@ -9,11 +9,11 @@ "Test `sx-assoc-let'" (sx-test-with-json-data data (should - (null (let-alist data .site)))) + (null (let-alist data .site_par)))) (sx-test-with-json-data data (should - (equal (sx-assoc-let data .site) + (equal (sx-assoc-let data .site_par) "meta.emacs"))) (sx-test-with-json-data data -- cgit v1.2.3