From ae01d7be431e60795314ec88bb91c9c241e63cfb Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Fri, 2 Feb 2024 15:17:01 -0500 Subject: [PATCH] Add a test for queued reminders. --- tests/queue1.rem | 6 ++++++ tests/queue2.rem | 1 + tests/test-rem | 3 +++ tests/test.cmp | 3 +++ 4 files changed, 13 insertions(+) create mode 100644 tests/queue1.rem create mode 100644 tests/queue2.rem diff --git a/tests/queue1.rem b/tests/queue1.rem new file mode 100644 index 00000000..2698bdae --- /dev/null +++ b/tests/queue1.rem @@ -0,0 +1,6 @@ +FSET msgprefix(x) "Priority: " + x + "; Filename: " + filename() + ": " + +REM at 23:59 MSG foo +REM PRIORITY 42 at 23:59 MSG bar +REM PRIORITY 999 at 23:39 MSQ quux +DO queue2.rem diff --git a/tests/queue2.rem b/tests/queue2.rem new file mode 100644 index 00000000..c37e9d9d --- /dev/null +++ b/tests/queue2.rem @@ -0,0 +1 @@ +REM at 23:59 PRIORITY 2 MSG XXXX diff --git a/tests/test-rem b/tests/test-rem index d1fddf50..dcce706e 100644 --- a/tests/test-rem +++ b/tests/test-rem @@ -440,6 +440,9 @@ rm -rf include_dir/ww # Test --version long option ../src/remind --version >> ../tests/test.out 2>&1 +# Test queueing +echo JSONQUEUE | ../src/remind -z0 ../tests/queue1.rem >> ../tests/test.out 2>&1 + # Remove references to SysInclude, which is build-specific grep -F -v '$SysInclude' < ../tests/test.out > ../tests/test.out.1 && mv -f ../tests/test.out.1 ../tests/test.out cmp -s ../tests/test.out ../tests/test.cmp diff --git a/tests/test.cmp b/tests/test.cmp index 5c899398..4b63f7bc 100644 --- a/tests/test.cmp +++ b/tests/test.cmp @@ -11706,3 +11706,6 @@ Error reading include_dir/ww: Can't open file SECURITY: Won't read world-writable file or directory! Error reading include_dir/ww: No files matching *.rem 04.02.08 +NOTE JSONQUEUE +[{"type":"MSG_TYPE","rundisabled":0,"ntrig":1,"priority":2,"filename":"../tests/queue2.rem","ttime":"23:59","nextttime":"23:59","delta":0,"rep":0,"body":"XXXX"},{"type":"MSG_TYPE","rundisabled":0,"ntrig":1,"priority":999,"filename":"../tests/queue1.rem","ttime":"23:39","nextttime":"23:39","delta":0,"rep":0,"body":"quux"},{"type":"MSG_TYPE","rundisabled":0,"ntrig":1,"priority":42,"filename":"../tests/queue1.rem","ttime":"23:59","nextttime":"23:59","delta":0,"rep":0,"body":"bar"},{"type":"MSG_TYPE","rundisabled":0,"ntrig":1,"priority":5000,"filename":"../tests/queue1.rem","ttime":"23:59","nextttime":"23:59","delta":0,"rep":0,"body":"foo"}] +NOTE ENDJSONQUEUE