#!/bin/bash test_description='listcon functionality This test checks basic context listing functionality ' . ./test-lib.sh cat > todo.txt < output && ! test -s output ' cat > todo.txt <>> todo.sh listcon @1 @c2 @con03 @con04 @con05@con06 EOF cat > todo.txt <>> todo.sh listcon @con01 @con02 @con03 EOF cat > todo.txt <>> todo.sh listcon @con01 @con02 EOF cat > todo.txt <>> todo.sh listcon +landscape @garden EOF cat > todo.txt <>> todo.sh listcon @GinaTrapani @home) @x @y EOF test_todo_session 'listcon limiting to multi-character sequences' <>> TODOTXT_SIGIL_VALID_PATTERN='.\{2,\}' todo.sh listcon @GinaTrapani @home) EOF test_todo_session 'listcon allowing w: marker before contexts' <>> TODOTXT_SIGIL_BEFORE_PATTERN='\(w:\)\{0,1\}' todo.sh listcon @GinaTrapani @OtherContributors @home) @x @y EOF test_todo_session 'listcon allowing parentheses around contexts' <>> TODOTXT_SIGIL_BEFORE_PATTERN='(\{0,1\}' TODOTXT_SIGIL_AFTER_PATTERN=')\{0,1\}' todo.sh listcon @GinaTrapani @home @school @x @y EOF test_todo_session 'listcon with all customizations combined' <>> TODOTXT_SIGIL_VALID_PATTERN='.\{2,\}' TODOTXT_SIGIL_BEFORE_PATTERN='\(w:\)\{0,1\}\((\)\{0,1\}' TODOTXT_SIGIL_AFTER_PATTERN=')\{0,1\}' todo.sh listcon @GinaTrapani @OtherContributors @home @school EOF cat > todo.txt < done.txt <>> TODOTXT_SOURCEVAR=\$DONE_FILE todo.sh listcon @done01 @done02 EOF test_todo_session 'listcon from combined open + done tasks' <<'EOF' >>> TODOTXT_SOURCEVAR='("$TODO_FILE" "$DONE_FILE")' todo.sh listcon @con01 @done01 @done02 EOF test_done