File: test_file.sh

package info (click to toggle)
argtable2 13-1
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 6,284 kB
  • sloc: sh: 9,928; ansic: 4,562; makefile: 101
file content (51 lines) | stat: -rwxr-xr-x 2,474 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh

echo $0 TESTS BEGIN

#these tests should all return zero (parse succeeded)
./test_file --help || exit 1

./test_file       foo.bar       foo.bar   foo.bar   .bar   || exit 1
./test_file      /foo.bar      /foo.bar   foo.bar   .bar   || exit 1
./test_file     ./foo.bar     ./foo.bar   foo.bar   .bar   || exit 1
./test_file   ././foo.bar   ././foo.bar   foo.bar   .bar   || exit 1
./test_file ./././foo.bar ./././foo.bar   foo.bar   .bar   || exit 1
./test_file    ../foo.bar    ../foo.bar   foo.bar   .bar   || exit 1
./test_file ../../foo.bar ../../foo.bar   foo.bar   .bar   || exit 1

./test_file       foo           foo       foo       ''     || exit 1
./test_file      /foo          /foo       foo       ''     || exit 1
./test_file     ./foo         ./foo       foo       ''     || exit 1
./test_file   ././foo       ././foo       foo       ''     || exit 1
./test_file ./././foo     ./././foo       foo       ''     || exit 1
./test_file    ../foo        ../foo       foo       ''     || exit 1
./test_file ../../foo     ../../foo       foo       ''     || exit 1

./test_file       .foo          .foo      .foo      ''     || exit 1
./test_file      /.foo         /.foo      .foo      ''     || exit 1
./test_file     ./.foo        ./.foo      .foo      ''     || exit 1
./test_file    ../.foo       ../.foo      .foo      ''     || exit 1

./test_file       foo.          foo.      foo.      ''     || exit 1
./test_file      /foo.         /foo.      foo.      ''     || exit 1
./test_file     ./foo.        ./foo.      foo.      ''     || exit 1
./test_file    ../foo.       ../foo.      foo.      ''     || exit 1

./test_file     /.foo.        /.foo.     .foo.      ''     || exit 1
./test_file    /.foo.c       /.foo.c    .foo.c      .c     || exit 1
./test_file /.foo..b.c    /.foo..b.c .foo..b.c      .c     || exit 1

./test_file          /             /        ''      ''     || exit 1
./test_file          .             .        ''      ''     || exit 1
./test_file         ..            ..        ''      ''     || exit 1
./test_file         /.            /.        ''      ''     || exit 1
./test_file        /..           /..        ''      ''     || exit 1
./test_file         ./            ./        ''      ''     || exit 1
./test_file        ../           ../        ''      ''     || exit 1

#these tests should all return non-zero (parse failed)
./test_file && exit 1


echo "$0 TESTS PASSED"
echo "----------------------------------"