From 90dedf05061aa173143b27fea98de78e0c316dd4 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Sat, 1 Nov 2014 02:05:14 -0400 Subject: Add function to filter data structure Only works on flat structures right now. This should be used and let-bound to a variable when that variable is going to be used a lot. Theoretically, it should be faster than traversing through the entire data structure. Think of this as a Emacs-local version of the API's own filter. --- tests.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests.el') diff --git a/tests.el b/tests.el index c79cfc4..0c520d8 100644 --- a/tests.el +++ b/tests.el @@ -25,3 +25,17 @@ "Test a method given a bad set of keywords" (should-error (stack-core-make-request "questions" '(())))) + +(ert-deftest test-data-filter-1 () + "Test the meta-convenience function" + (should + (equal + '((1 . t) (2 . [1 2]) (3)) + (stack-core-filter-data '((0 . 3) + (1 . t) + (a . five) + (2 . [1 2]) + ("5" . bop) + (3) + (p . 4)) + '(1 2 3))))) -- cgit v1.2.3