File: basics.t

package info (click to toggle)
freebayes 1.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,628 kB
  • sloc: cpp: 121,209; ansic: 3,925; sh: 911; python: 455; asm: 271; makefile: 213; perl: 27
file content (26 lines) | stat: -rw-r--r-- 917 bytes parent folder | download | duplicates (5)
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
#!/bin/bash

PATH=lib:$PATH
source test-simple.bash tests 14

ok 0                            '0 is true'
ok $((6 * 7 -42))               'Math result is 0'
ok true                         'true is ok'
ok $(false || true; echo $?)    'Expression expansion'

ls &> /dev/null
ok $?                           '$? is success'
ls --qqq &> /dev/null
ok $((! $?))                    'Negate $? failure'

fruit=apple

ok [ $fruit = apple ]           '[ … ] testing works'
ok [ "0" == "0" -a 1 -eq 1 ]    '[ … -a … ] (AND) testing works'
ok [ ${fruit/a/A} = Apple ]     'Substitution expansion works'
ok [ "${fruit}s" = 'app''les' ] 'Quote removal works'
ok [[ $fruit = apple ]]         '[[ … ]] works'
ok [[ $fruit == apple ]]        '== works'
ok [[ $((6 * 7)) -eq 42 ]]      '-eq works with math expression'
ok $(ls | grep lib &> /dev/null; echo $?) \
                                'Testing a grep command works'