From 79c860053b138fe78d4577c8b00de286dacbb92e Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Fri, 9 Jul 2021 22:11:11 -0400 Subject: [PATCH] tests: Add a regression test for #2530 --- test/tw-2530.t | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 test/tw-2530.t diff --git a/test/tw-2530.t b/test/tw-2530.t new file mode 100755 index 000000000..5699bbbb4 --- /dev/null +++ b/test/tw-2530.t @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +. bash_tap_tw.sh + +# Setup the tasks +task add wait:1w this should INDEED show up +task add this should NOT show up +sleep 1 + +# Check that the wait.before filter displays the correct number of tasks +task wait.before:1w all + +# Assertion: The task without wait attribute does not show up +[[ -z `task wait.before:1w all | grep NOT` ]] + +# Assertion: The task with the wait attribute DOES show up +[[ ! -z `task wait.before:1w all | grep INDEED` ]] + +# Assertion: There is exactly one task matching the filter +[[ `task wait.before:1w count` == 1 ]]