File: t6010-completion-contexts.sh

package info (click to toggle)
todotxt-cli 2.11.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,312 kB
  • sloc: sh: 5,393; makefile: 67
file content (27 lines) | stat: -rwxr-xr-x 912 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
#

test_description='Bash context completion functionality

This test checks todo_completion of contexts
'
. ./test-lib.sh

cat > todo.txt <<EOF
(B) smell the +roses @outside @outdoor +shared
notice the sunflowers +sunflowers @outside @garden +shared +landscape
stop
EOF
cat > done.txt <<EOF
x 2012-02-21 +herbs @oriental buy spices
x 2012-02-21 +slack @home watch tv
EOF
test_todo_completion 'all contexts' 'todo-txt list @' '@garden @outdoor @outside'
test_todo_completion 'contexts beginning with o' 'todo-txt list @o' '@outdoor @outside'
test_todo_completion 'contexts beginning with outs' 'todo-txt list @outs' '@outside'
test_todo_completion 'contexts beginning with x' 'todo-txt list @x' ''

test_todo_completion 'contexts from done tasks beginning with h' 'todo-txt list @h' '@home'
test_todo_completion 'contexts from done tasks beginning with or' 'todo-txt list @or' '@oriental'

test_done