File: usropt-2.tst

package info (click to toggle)
a2ps 1:4.14-2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 13,328 kB
  • sloc: ansic: 26,966; sh: 11,844; lex: 2,286; perl: 1,156; yacc: 757; makefile: 609; lisp: 398; ada: 263; objc: 189; f90: 109; ml: 85; sql: 74; pascal: 57; modula3: 33; haskell: 32; sed: 30; java: 29; python: 24
file content (29 lines) | stat: -rwxr-xr-x 805 bytes parent folder | download | duplicates (10)
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
#! /bin/sh
# -*- ksh -*-

# Check that the user options work correctly.
# Specifically, that option processing is not broken by user options.

# We use a dummy option/value which cannot change the test:
# for instance --stdin stdin-name

# The testing file
IN_NAME=tabulation.pre

. ./defs || exit 1

# -=useroption-test is --guess, so only 1 line is expected
lines=`$CHK -=useroption-test --stdin=stdin-name $TST_FILE 2>/dev/null | wc -l`
test $lines = 1 || exit 1

lines=`$CHK $TST_FILE --stdin=stdin-name -=useroption-test 2>/dev/null | wc -l`
test $lines = 1 || exit 1

lines=`$CHK -=useroption-test $TST_FILE --stdin=stdin-name 2>/dev/null | wc -l`
test $lines = 1 || exit 1

lines=`$CHK $TST_FILE -=useroption-test --stdin=stdin-name 2>/dev/null | wc -l`
test $lines = 1 || exit 1

# Success
exit 0