Mercurial > projects > dstress
changeset 926:fe8d9fe23320
<braddr@puremagic.com>
2006-03-12
news:bug-38-3@http.d.puremagic.com/bugzilla/
author | thomask |
---|---|
date | Tue, 21 Mar 2006 10:42:02 +0000 |
parents | 780b11b4cd2f |
children | 0b6d91f18d09 |
files | run/t/template_34_A.d run/t/template_34_B.d run/t/template_34_C.d run/t/template_34_D.d |
diffstat | 4 files changed, 136 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/template_34_A.d Tue Mar 21 10:42:02 2006 +0000 @@ -0,0 +1,34 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <braddr@puremagic.com> +// @date@ 2006-03-12 +// @uri@ news:bug-38-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.t.template_34_A; + +int main() { + char[][] result, test; + + foreach (x; test) { + if (exists!(char[][], char[])(result, x) == true) { + assert(0); + } + } + + return 0; +} + +template exists(T, U) { + bool exists(T src, U test) { + foreach (x; src) { + if (x == test) { + return true; + } + } + + return false; + } +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/template_34_B.d Tue Mar 21 10:42:02 2006 +0000 @@ -0,0 +1,34 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <braddr@puremagic.com> +// @date@ 2006-03-12 +// @uri@ news:bug-38-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.t.template_34_B; + +int main() { + char[][] result, test; + + foreach (x; test) { + if(exists(result, x) == true){ + assert(0); + } + } + + return 0; +} + +template exists(T, U) { + bool exists(T src, U test) { + foreach (x; src) { + if (x == test) { + return true; + } + } + + return false; + } +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/template_34_C.d Tue Mar 21 10:42:02 2006 +0000 @@ -0,0 +1,34 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <braddr@puremagic.com> +// @date@ 2006-03-12 +// @uri@ news:bug-38-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.t.template_34_C; + +int main() { + char[][] result, test; + + foreach (x; test) { + if(exists(result, x) == true){ + assert(0); + } + } + + return 0; +} + +template exists(T, U) { + bool exists(T[][] src, U[] test) { + foreach (x; src) { + if (x == test) { + return true; + } + } + + return false; + } +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/template_34_D.d Tue Mar 21 10:42:02 2006 +0000 @@ -0,0 +1,34 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <braddr@puremagic.com> +// @date@ 2006-03-12 +// @uri@ news:bug-38-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.t.template_34_D; + +int main() { + char[][] result, test; + + foreach (x; test) { + if (exists!(char[][], char[])(result, x) == true) { + assert(0); + } + } + + return 0; +} + +template exists(T, U) { + bool exists(T[][] src, U[] test) { + foreach (x; src) { + if (x == test) { + return true; + } + } + + return false; + } +} +