diff options
author | Sean Allred <code@seanallred.com> | 2014-11-01 02:05:14 -0400 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2014-11-01 02:05:14 -0400 |
commit | 75439b37dc68fa10bcec979fd1538576816b49fb (patch) | |
tree | dd72adf8cb5afdedb88896427808a85d2f474374 /tests.el | |
parent | 8f68c1d920affe654b7b14db0218bf02b4ec9c12 (diff) |
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.
Diffstat (limited to 'tests.el')
-rw-r--r-- | tests.el | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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))))) |