[go: up one dir, main page]

File: test9.sh

package info (click to toggle)
findent 2.8.2-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 1,756 kB
  • sloc: sh: 3,365; cpp: 2,780; fortran: 1,214; lex: 324; yacc: 246; makefile: 155; python: 155; lisp: 52
file content (47 lines) | stat: -rwxr-xr-x 906 bytes parent folder | download
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
#!/bin/sh
. ./prelude
rc=0
prog="  program main
10      continue
      end
   "
expect="program main
      10      continue
end"
exe=$FINDENT
for flag in -l0 --label_left=0 ; do
   a=`echo "$prog" | $exe "$flag" -I0 -i6 | tr -d '\r'`
   if [ "$a" = "$expect" ]; then
      echo "$flag works OK"
   else
      echo "$flag works NOT OK:"
      echo "expected:"
      echo "$expect"
      echo "got     :"
      echo "$a"
      echo "program is:"
      echo "$prog"
      rc=`expr $rc + 1`
   fi
done

expect="program main
10    continue
end"
for flag in -l1 --label_left=1 ; do
   a=`echo "$prog" | $exe "$flag" -I0 -i6 | tr -d '\r'`
   if [ "$a" = "$expect" ]; then
      echo "$flag works OK"
   else
      echo "$flag works NOT OK:"
      echo "expected:"
      echo "$expect"
      echo "got     :"
      echo "$a"
      echo "program is:"
      echo "$prog"
      rc=`expr $rc + 1`
   fi
done

exit $rc