1: \ xchar word test suite - UTF-8 only
2:
3: hex
4:
5: { 0 xc-size -> 1 }
6: { 7f xc-size -> 1 }
7: { 80 xc-size -> 2 }
8: { 7ff xc-size -> 2 }
9: { 800 xc-size -> 3 }
10: { ffff xc-size -> 3 }
11: { 10000 xc-size -> 4 }
12: { 1fffff xc-size -> 4 }
13:
14: : test-string s" 恭喜发财!" ;
15:
16: { test-string drop xc@+ swap xc@+ swap xc@+ swap xc@+ swap xc@+ nip
17: -> 606D 559C 53D1 8D22 21 }
18: { ffff pad 4 xc!+? -> pad 3 + 1 true }
19: { test-string drop xchar+ -> test-string drop 3 + }
20: { test-string drop xchar+ xchar- -> test-string drop }
21: { test-string +x/string -> test-string 3 /string }
22: { test-string x\string- x\string- -> test-string 4 - }
23: { test-string x-size -> 3 }
24: { test-string -trailing-garbage -> test-string }
25: { test-string 2 - -trailing-garbage -> test-string 4 - }
26:
27: { 0. <# s" Test" holds #> s" Test" compare -> 0 }
28: { 0. <# 606D xhold #> s" 恭" compare -> 0 }
29:
30: { 606D xc-width -> 2 }
31: { 41 xc-width -> 1 }
32: { 2060 xc-width -> 0 }
33: { test-string x-width -> 9 }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>