File: t6000-completion.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 (22 lines) | stat: -rwxr-xr-x 1,088 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
#!/bin/bash
#

test_description='Bash completion functionality

This test checks basic todo_completion of actions and options
'
. ./test-lib.sh

readonly ACTIONS='add a addto addm append app archive command del rm depri dp do help list ls listaddons listall lsa listcon lsc listfile lf listpri lsp listproj lsprj move mv prepend prep pri p replace report shorthelp'
readonly OPTIONS='-@ -@@ -+ -++ -d -f -h -p -P -PP -a -n -t -v -vv -V -x'

test_todo_completion 'all arguments' 'todo-txt ' "$ACTIONS $OPTIONS"
test_todo_completion 'arguments beginning with a' 'todo-txt a' 'add a addto addm append app archive'
test_todo_completion 'all options' 'todo-txt -' "$OPTIONS"
test_todo_completion 'all actions after command action' 'todo-txt command ' "$ACTIONS"
test_todo_completion 'all arguments after option' 'todo-txt -a ' "$ACTIONS $OPTIONS"
test_todo_completion 'all arguments after options' 'todo-txt -a -p ' "$ACTIONS $OPTIONS"
test_todo_completion 'all options after options' 'todo-txt -a -p -' "$OPTIONS"
test_todo_completion 'nothing after action' 'todo-txt archive ' ''

test_done