From 7fb457d89252502b08e763fb295863a2eb02e4e5 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sun, 15 Aug 2021 16:36:26 -0400 Subject: [PATCH] test: Add tests for TW #2550 --- test/tw-2550.t | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 test/tw-2550.t diff --git a/test/tw-2550.t b/test/tw-2550.t new file mode 100755 index 000000000..3a1e044ff --- /dev/null +++ b/test/tw-2550.t @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +. bash_tap_tw.sh + +# Setup the context +task config context.work.read '+work' +task config context.work.write '+work' + +# Create a task outside of the context +task add outside + +# Activate the context +task context work + +# Add multiple tasks within the context, some of which contain numbers or uuids +task add inside +task add inside 2 +task add inside 3 +task add inside aabbccdd +task add inside 4-5 + +# Assertion: Task defined outside of the context should not show up +[[ -z `task all | grep outside` ]] + +# Five tasks were defined within the context +task count +[[ `task count` == "5" ]] + +# Unset the context +task context none + +# Exactly five tasks have the tag work +task +work count +[[ `task +work count` == "5" ]]