From 50de1b090fd8619ea4135ff885fba32486d11e47 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sun, 21 Apr 2024 11:22:26 +0100 Subject: [PATCH] add the rest of the test list (all we've thought of) --- pkgs/devout/test.fnl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pkgs/devout/test.fnl b/pkgs/devout/test.fnl index 4db3982..ed7a106 100644 --- a/pkgs/devout/test.fnl +++ b/pkgs/devout/test.fnl @@ -100,5 +100,24 @@ MINOR=17") (expect= (# (db:find {:devname "sda" :devtype "dosk"})) 0))) +;;; tests for indices + +(example "when I add a device with $attributes major minor foo bar baz, + it is added to indices for foo bar baz but not major minor") + +(example "a removed device can no longer be found by looking in any index") + +(example "when I query with multiple attributes, the search is performed using the most specific attribute" + ;; (= the attribute whose + ;; value at this key has fewest elements) + ) + +;;; tests for subscriptions + +(example "I can subscribe to some search terms") + +(example "my callback is invoked when devices matching those terms are + added/changed/removed") + (if failed (os.exit 1) (print "OK"))