File: eightbit.sh

package info (click to toggle)
cssc 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 10,540 kB
  • ctags: 10,602
  • sloc: cpp: 39,776; sh: 16,907; ansic: 13,767; python: 3,923; makefile: 1,698; perl: 342; awk: 15
file content (78 lines) | stat: -rw-r--r-- 1,828 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
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#! /bin/sh
# eightbit.sh:  Testing for 8-bit clean operation 

# Import common functions & definitions.
. ../common/test-common
. ../common/real-thing
. ../common/config-data


if $binary_support
then
    true
else
    echo "Skipping these tests -- no binary file support."
    exit 0
fi 


g=8bit.txt
p=p.$g
s=s.$g
x=x.$g
z=z.$g


cleanup() {
   remove command.log log log.stdout log.stderr
   remove char255.txt s.char255.txt s.umsp.txt
   remove $p $x $s $z $g
   remove passwd command.log last.command
   remove got.stdout expected.stdout got.stderr expected.stderr
   rm -rf test
}

cleanup

# At the moment, just create an SCCS file from 8-bit characters and
# make sure the checksum is OK.

# If the next line is incomprehensible to you, that's OK. 
# It contains ISO-8859-1 characters.  But the important thing
# is that they are outside the range 0...127.
remove $g
echo "garon maana " >$g
docommand a1 "${vg_admin} -i$g $s" 0 IGNORE IGNORE
docommand a2 "${vg_get} -p $s" 0 "garon maana \n" IGNORE

echo_nonl a3...
if ../../testutils/uu_decode --decode < s.umsp.uue
then
    echo passed
else
    miscarry uudecode failed.
fi

docommand a4 "${vg_get} -p s.umsp.txt" 0 "garon maana \n" IGNORE


## We must be able to manipulate normally files containing 
## the ISO 8859 character whose code is 255 (y-umlaut).
## EOF is often (-1) and if a char has carelessly been used
## to hold the result of a getchar(), we may detect y-umlaut
## as EOF.  That would be a bug.

echo_nonl a5...
if ../../testutils/uu_decode --decode < char255.uue
then
    echo passed
else
    miscarry uudecode failed.
fi

remove s.char255.txt
docommand a6 "${vg_admin} -ichar255.txt s.char255.txt" 0 IGNORE IGNORE
docommand a7 "${vg_get} -k -p s.char255.txt" 0 "\n" "1.1\n1 lines\n"

cleanup
success