File: test-errors.sh

package info (click to toggle)
enca 1.21-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,948 kB
  • sloc: ansic: 10,297; sh: 5,858; xml: 2,132; makefile: 700; perl: 261
file content (26 lines) | stat: -rwxr-xr-x 831 bytes parent folder | download | duplicates (4)
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/sh
# Purpose: check how enca reacts on various incorrect inputs
. $srcdir/setup.sh
TEST_TEXT=$srcdir/cs-s.iso88592
LC_CTYPE=
LC_COLLATE=
LC_MESSAGES=
LC_ALL=
LANG=
# This is necessary when $ENCA is in fact a libtool script
export LC_CTYPE LC_ALL LC_COLLATE LC_MESSAGES LANG
# These should succeede
# If they set some options, they should keep defaults.
$ENCA -L cs --name puskin >/dev/null 2>/dev/null <$TEST_TEXT || DIE=1
$ENCA -L cs -C gogol >/dev/null 2>/dev/null <$TEST_TEXT || DIE=1
# These should fail.
$ENCA -L bulgakov >/dev/null 2>/dev/null <$TEST_TEXT && DIE=1
$ENCA -L none dostojevskij 2>/dev/null && DIE=1
touch zombie
chmod 000 zombie
$ENCA -L none zombie 2>/dev/null && DIE=1
chmod 700 zombie
rm -f zombie 2>/dev/null
# Test no converter
$ENCA -C none -L cs -x utf-8 <$TEST_TEXT && DIE=1
. $srcdir/finish.sh