1#!/usr/bin/expect -f
2set timeout 1
3
4spawn tests/conv_encoding Japanese CP932 UTF-8
5expect_after {
6    "\[^\r\n\]*\r\n" { fail $test }
7}
8set test "CP932"
9send "\xc2\xa5\r"
10sleep 0.01
11expect {
12    "%5c (1)\r\n" { pass $test }
13}
14close
15
16spawn tests/conv_encoding Japanese SJIS-open UTF-8
17expect_after {
18    "\[^\r\n\]*\r\n" { fail $test }
19}
20set test "SJIS-open"
21send "\xc2\xa5\r"
22sleep 0.01
23expect {
24    "%81%8f (2)\r\n" { pass $test }
25}
26close
27
28spawn tests/conv_encoding Japanese eucJP-open UTF-8
29expect_after {
30    "\[^\r\n\]*\r\n" { fail $test }
31}
32set test "eucJP-open"
33send "\xc2\xa5\r"
34sleep 0.01
35expect {
36    "%a1%ef (2)\r\n" { pass $test }
37}
38close
39
40spawn tests/conv_encoding Japanese CP51932 UTF-8
41expect_after {
42    "\[^\r\n\]*\r\n" { fail $test }
43}
44set test "CP51932"
45send "\xc2\xa5\r"
46sleep 0.01
47expect {
48    "%5c (1)\r\n" { pass $test }
49}
50close
51
52spawn tests/conv_encoding Japanese ISO-2022-JP-MS UTF-8
53expect_after {
54    "\[^\r\n\]*\r\n" { fail $test }
55}
56set test "ISO-2022-JP-MS"
57send "\xc2\xa5\r"
58sleep 0.01
59expect {
60    "%1b%24%42%21%6f%1b%28%42 (8)\r\n" { pass $test }
61}
62close
63
64spawn tests/conv_encoding Japanese CP50220 UTF-8
65expect_after {
66    "\[^\r\n\]*\r\n" { fail $test }
67}
68set test "CP50220"
69send "\xc2\xa5\r"
70sleep 0.01
71expect {
72    "%1b%28%4a%5c%1b%28%42 (7)\r\n" { pass $test }
73}
74close
75
76spawn tests/conv_encoding Japanese CP50221 UTF-8
77expect_after {
78    "\[^\r\n\]*\r\n" { fail $test }
79}
80set test "CP50221"
81send "\xc2\xa5\r"
82sleep 0.01
83expect {
84    "%1b%28%4a%5c%1b%28%42 (7)\r\n" { pass $test }
85}
86close
87
88spawn tests/conv_encoding Japanese CP50222 UTF-8
89expect_after {
90    "\[^\r\n\]*\r\n" { fail $test }
91}
92set test "CP50222"
93send "\xc2\xa5\r"
94sleep 0.01
95expect {
96    "%1b%28%4a%5c%1b%28%42 (7)\r\n" { pass $test }
97}
98close
99# vim: sts=4 ts=4 sw=4 et
100