Mercurial > projects > dstress
changeset 778:3d0a93b29fc6
Thomas Kuehne <thomas-dloop@kuehne.cn>
2005-12-17
news:o7fc73-4ci.ln1@birke.kuehne.cn
author | thomask |
---|---|
date | Fri, 16 Dec 2005 23:45:16 +0000 |
parents | 2f10fa84a21b |
children | 6bc77a88fee3 |
files | run/w/wchar_10_A.d run/w/wchar_10_B.d |
diffstat | 2 files changed, 78 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/w/wchar_10_A.d Fri Dec 16 23:45:16 2005 +0000 @@ -0,0 +1,39 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Thomas Kuehne <thomas-dloop@kuehne.cn> +// @date@ 2005-12-17 +// @uri@ news:o7fc73-4ci.ln1@birke.kuehne.cn + +module dstress.run.f.foreach_31_F; + +int main(){ + wchar[] s = "_\U00012345-"w; + + int[] index; + char[] value; + + foreach(int i, char c; s){ + index ~= i; + value ~= c; + } + + assert(value.length == 6); + assert(value[0] == '_'); + assert(value[1] == 0xF0); + assert(value[2] == 0x92); + assert(value[3] == 0x8D); + assert(value[4] == 0x85); + assert(value[5] == '-'); + + assert(index.length == 6); + assert(index[0] == 0); + assert(index[1] == 1); + assert(index[2] == 1); + assert(index[3] == 1); + assert(index[4] == 1); + assert(index[5] == 3); + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/w/wchar_10_B.d Fri Dec 16 23:45:16 2005 +0000 @@ -0,0 +1,39 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Thomas Kuehne <thomas-dloop@kuehne.cn> +// @date@ 2005-12-17 +// @uri@ news:o7fc73-4ci.ln1@birke.kuehne.cn + +module dstress.run.f.foreach_31_F; + +int main(){ + wchar[] s = "_\U00012345-"w; + + int[] index; + char[] value; + + foreach(int i, char c; s){ + index ~= i; + value ~= c; + } + + assert(value.length == 6); + assert(value[0] == '_'); + assert(value[1] == 0xF0); + assert(value[2] == 0x92); + assert(value[3] == 0x8D); + assert(value[4] == 0x85); + assert(value[5] == '-'); + + assert(index.length == 6); + assert(index[0] == 0); + assert(index[1] == 1); + assert(index[2] == 1); + assert(index[3] == 1); + assert(index[4] == 1); + assert(index[5] == 3); + + return 0; +}