Annotation of gforth/test/xchar.fs, revision 1.2
1.1 pazsan 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 -> 606D 559C 53D1 8D22 21 }
17: { ffff pad 4 xc!+? -> pad 3 + 1 true }
18: { test-string drop xchar+ -> test-string drop 3 + }
19: { test-string drop xchar+ xchar- -> test-string drop }
20: { test-string +x/string -> test-string 3 /string }
21: { test-string x\string- x\string- -> test-string 4 - }
22: { test-string x-size -> 3 }
23: { test-string -trailing-garbage -> test-string }
24: { test-string 2 - -trailing-garbage -> test-string 4 - }
25:
26: { 0. <# s" Test" holds #> s" Test" compare -> 0 }
27: { 0. <# 606D xhold #> s" 恭" compare -> 0 }
28:
29: { 606D xc-width -> 2 }
30: { 41 xc-width -> 1 }
31: { 2060 xc-width -> 0 }
32: { test-string x-width -> 9 }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>