File: t0100-code-nobacktick.sh

package info (click to toggle)
todotxt-cli 2.11.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 1,312 kB
  • sloc: sh: 5,393; makefile: 67
file content (23 lines) | stat: -rwxr-xr-x 537 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
#!/bin/bash

test_description='no old-style backtick command substitution

This test checks the todo.sh script itself for occurrences
of old-style backtick command substitution, which should be
replaced with $(...).
On failure, it will print each offending line number and line.
'
. ./test-lib.sh

backtick_check()
{
    sed -n -e 's/\(^\|[ \t]\)#.*//' -e '/`/{' -e '=;p' -e '}' "$@"
}

test_todo_session 'no old-style backtick command substitution' <<EOF
>>> backtick_check bin/todo.sh

>>> backtick_check ../../todo.cfg
EOF

test_done