Annotation of embedaddon/php/ext/mbstring/libmbfl/tests/strcut.tests/ujis.exp, revision 1.1
1.1 ! misho 1: #!/usr/bin/expect -f
! 2: proc begin_strcut_test {_from _length} {
! 3: global spawn_id from length
! 4: set from $_from
! 5: set length $_length
! 6:
! 7: spawn tests/strcut Japanese EUC-JP $_from $_length
! 8: set timeout 1
! 9:
! 10: expect_after {
! 11: "\[^\r\n\]*\r\n" { fail $test }
! 12: }
! 13: }
! 14:
! 15: begin_strcut_test -1 2
! 16:
! 17: set test "asciish characters ($from, $length)"
! 18: send "testtest\r"
! 19: expect {
! 20: -ex "***ERROR***\r\n" { pass $test }
! 21: }
! 22:
! 23: set test "non-asciish characters ($from, $length)"
! 24: send "テストテスト\r"
! 25: expect {
! 26: -ex "***ERROR***\r\n" { pass $test }
! 27: }
! 28:
! 29: close
! 30: begin_strcut_test 2 -1
! 31:
! 32: set test "asciish characters ($from, $length)"
! 33: send "testtest\r"
! 34: expect {
! 35: -ex "***ERROR***\r\n" { pass $test }
! 36: }
! 37:
! 38: set test "non-asciish characters ($from, $length)"
! 39: send "テストテスト\r"
! 40: expect {
! 41: -ex "***ERROR***\r\n" { pass $test }
! 42: }
! 43:
! 44: close
! 45: begin_strcut_test 3 2
! 46:
! 47: set test "asciish characters ($from, $length)"
! 48: send "testtest\r"
! 49: expect {
! 50: -ex "%74%74 (2)\r\n" { pass $test }
! 51: }
! 52:
! 53: set test "non-asciish characters ($from, $length)"
! 54: send "テストテスト\r"
! 55: expect {
! 56: -ex "%a5%b9 (2)\r\n" { pass $test }
! 57: }
! 58:
! 59: close
! 60: begin_strcut_test 5 8
! 61:
! 62: set test "asciish characters ($from, $length)"
! 63: send "testtest\r"
! 64: expect {
! 65: -ex "%65%73%74 (3)\r\n" { pass $test }
! 66: }
! 67:
! 68: set test "non-asciish characters ($from, $length)"
! 69: send "テストテスト\r"
! 70: expect {
! 71: -ex "%a5%c8%a5%c6%a5%b9%a5%c8 (8)\r\n" { pass $test }
! 72: }
! 73:
! 74: close
! 75: begin_strcut_test 1 15
! 76:
! 77: set test "asciish characters ($from, $length)"
! 78: send "testestestestestes\r"
! 79: expect {
! 80: "%65%73%74%65%73%74%65%73%74%65%73%74%65%73%74 (15)\r\n" { pass $test }
! 81: }
! 82:
! 83: set test "non-asciish characters ($from, $length)"
! 84: send "テストテスト\r"
! 85: expect {
! 86: -ex "%a5%c6%a5%b9%a5%c8%a5%c6%a5%b9%a5%c8 (12)\r\n" { pass $test }
! 87: }
! 88: close
! 89:
! 90:
! 91: # vim: sts=4 sw=4 ts=4 et encoding=EUC-JP
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>