From 1f768565793d99fc46c00fa666acd1392eaba6e0 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sat, 21 Aug 2021 01:01:19 -0400 Subject: [PATCH] tests: Add test for TW #2581 --- test/tw-2581.t | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 test/tw-2581.t diff --git a/test/tw-2581.t b/test/tw-2581.t new file mode 100755 index 000000000..b7120a3a6 --- /dev/null +++ b/test/tw-2581.t @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# Test setting configuration variable with a trailing comment works +. bash_tap_tw.sh + +# Add configuration variable with a trailing comment into taskrc +echo 'weekstart=Monday # Europe standard' >> taskrc +cat taskrc + +# Use config the change the value to "Sunday" +task config weekstart Sunday + +# Ensure the comment was preserved and value changed +cat taskrc | grep weekstart=Sunday +[[ `cat taskrc | grep weekstart=Sunday` == 'weekstart=Sunday # Europe standard' ]]