xref: /freebsd/contrib/one-true-awk/testdir/T.latin1 (revision 23f24377b1a9ab6677f00f2302484d6658d94cab)
1*23f24377SWarner Loshecho T.latin1: tests of 8-bit input
2*23f24377SWarner Losh
3*23f24377SWarner Loshawk=${awk-../a.out}
4*23f24377SWarner Losh
5*23f24377SWarner Losh$awk '
6*23f24377SWarner Losh{ print $0 }
7*23f24377SWarner Losh' latin1 >foo1
8*23f24377SWarner Losh
9*23f24377SWarner Loshdiff latin1 foo1 || echo 'BAD: T.latin1 1'
10*23f24377SWarner Losh
11*23f24377SWarner Losh$awk '{ gsub(/\351/, "\370"); print }' latin1 >foo0
12*23f24377SWarner Losh$awk '{ gsub(/�/, "�"); print }' latin1 >foo1
13*23f24377SWarner Loshdiff foo0 foo1 || echo 'BAD: T.latin1 3'
14*23f24377SWarner Losh
15*23f24377SWarner Losh$awk '{ gsub(/[^\300-\370]/, ""); print }' latin1 >foo0
16*23f24377SWarner Losh$awk '{ gsub(/[^�-�]/, ""); print } ' latin1 >foo1
17*23f24377SWarner Loshdiff foo0 foo1 || echo 'BAD: T.latin1 4'
18*23f24377SWarner Losh
19*23f24377SWarner Loshecho  '/�/' >foo1
20*23f24377SWarner Losh$awk -f foo1 foo1 >foo2
21*23f24377SWarner Losh
22*23f24377SWarner Loshdiff foo1 foo2 || echo 'BAD: T.latin1 5'
23*23f24377SWarner Losh
24*23f24377SWarner Losh
25*23f24377SWarner Loshecho /[��]/ >foo1
26*23f24377SWarner Losh$awk -f foo1 foo1 >foo2
27*23f24377SWarner Loshdiff foo1 foo2 || echo 'BAD: T.latin1 6'
28*23f24377SWarner Losh
29*23f24377SWarner Losh
30*23f24377SWarner Loshecho 'This is a line.
31*23f24377SWarner LoshPatterns like /[��]/ do not work yet. Example, run awk /[��]/
32*23f24377SWarner Loshover a file containing just �.
33*23f24377SWarner LoshThis is another line.' >foo0
34*23f24377SWarner Loshecho 'Patterns like /[��]/ do not work yet. Example, run awk /[��]/
35*23f24377SWarner Loshover a file containing just �.' >foo1
36*23f24377SWarner Losh$awk '/[��]/' foo0 >foo2
37*23f24377SWarner Loshdiff foo1 foo2 || echo 'BAD: T.latin1 7'
38