1#!/usr/bin/expect -f 2spawn tests/strwidth Japanese UTF-8 3set timeout 1 4 5expect_after { 6 "\[^\r\n\]*\r\n" { fail $test } 7} 8 9set test "basic test" 10send "testtest\r" 11expect { 12 "8\r\n" { pass $test } 13} 14 15set test "CJK kanji" 16send "漢字\r" 17expect { 18 "4\r\n" { pass $test } 19} 20 21set test "CJK hiragana" 22send "ひらがな\r" 23expect { 24 "8\r\n" { pass $test } 25} 26 27set test "CJK katakana" 28send "カタカナ\r" 29expect { 30 "8\r\n" { pass $test } 31} 32 33set test "Fullwidth symbols (1)" 34send "〜!”#$%&’())\r" 35expect { 36 "20\r\n" { pass $test } 37} 38 39set test "Halfwidth symbols assumed to be fullwidth in JISX0208 (2)" 40send "○●◎\r" 41expect { 42 "3\r\n" { pass $test } 43} 44 45close 46 47# vim: sts=4 sw=4 ts=4 et encoding=UTF-8 48