File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
mbstring /
libmbfl /
tests /
strwidth.tests /
strwidth.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
spawn tests/strwidth Japanese UTF-8
set timeout 1
expect_after {
"\[^\r\n\]*\r\n" { fail $test }
}
set test "basic test"
send "testtest\r"
expect {
"8\r\n" { pass $test }
}
set test "CJK kanji"
send "漢字\r"
expect {
"4\r\n" { pass $test }
}
set test "CJK hiragana"
send "ひらがな\r"
expect {
"8\r\n" { pass $test }
}
set test "CJK katakana"
send "カタカナ\r"
expect {
"8\r\n" { pass $test }
}
set test "Fullwidth symbols (1)"
send "〜!”#$%&’())\r"
expect {
"20\r\n" { pass $test }
}
set test "Halfwidth symbols assumed to be fullwidth in JISX0208 (2)"
send "○●◎\r"
expect {
"3\r\n" { pass $test }
}
close
# vim: sts=4 sw=4 ts=4 et encoding=UTF-8
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>