File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
mbstring /
libmbfl /
tests /
strcut.tests /
ujis.exp
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:47:57 2012 UTC (12 years, 6 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
#!/usr/bin/expect -f
proc begin_strcut_test {_from _length} {
global spawn_id from length
set from $_from
set length $_length
spawn tests/strcut Japanese EUC-JP $_from $_length
set timeout 1
expect_after {
"\[^\r\n\]*\r\n" { fail $test }
}
}
begin_strcut_test -1 2
set test "asciish characters ($from, $length)"
send "testtest\r"
expect {
-ex "***ERROR***\r\n" { pass $test }
}
set test "non-asciish characters ($from, $length)"
send "テストテスト\r"
expect {
-ex "***ERROR***\r\n" { pass $test }
}
close
begin_strcut_test 2 -1
set test "asciish characters ($from, $length)"
send "testtest\r"
expect {
-ex "***ERROR***\r\n" { pass $test }
}
set test "non-asciish characters ($from, $length)"
send "テストテスト\r"
expect {
-ex "***ERROR***\r\n" { pass $test }
}
close
begin_strcut_test 3 2
set test "asciish characters ($from, $length)"
send "testtest\r"
expect {
-ex "%74%74 (2)\r\n" { pass $test }
}
set test "non-asciish characters ($from, $length)"
send "テストテスト\r"
expect {
-ex "%a5%b9 (2)\r\n" { pass $test }
}
close
begin_strcut_test 5 8
set test "asciish characters ($from, $length)"
send "testtest\r"
expect {
-ex "%65%73%74 (3)\r\n" { pass $test }
}
set test "non-asciish characters ($from, $length)"
send "テストテスト\r"
expect {
-ex "%a5%c8%a5%c6%a5%b9%a5%c8 (8)\r\n" { pass $test }
}
close
begin_strcut_test 1 15
set test "asciish characters ($from, $length)"
send "testestestestestes\r"
expect {
"%65%73%74%65%73%74%65%73%74%65%73%74%65%73%74 (15)\r\n" { pass $test }
}
set test "non-asciish characters ($from, $length)"
send "テストテスト\r"
expect {
-ex "%a5%c6%a5%b9%a5%c8%a5%c6%a5%b9%a5%c8 (12)\r\n" { pass $test }
}
close
# vim: sts=4 sw=4 ts=4 et encoding=EUC-JP
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>