changeset 49:1a7241967792

1) extended version test cases 2) updated sort test cases 3) updated todo
author thomask
date Sat, 16 Oct 2004 16:55:42 +0000
parents adec6137fc98
children 6e5067190fea
files nocompile/version_12.d nocompile/version_13.d nocompile/version_14.d nocompile/version_15.d run/sort_02.d run/sort_03.d run/sort_04.d run/sort_05.d todo.txt
diffstat 9 files changed, 118 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nocompile/version_12.d	Sat Oct 16 16:55:42 2004 +0000
@@ -0,0 +1,2 @@
+version(){
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nocompile/version_13.d	Sat Oct 16 16:55:42 2004 +0000
@@ -0,0 +1,1 @@
+version()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nocompile/version_14.d	Sat Oct 16 16:55:42 2004 +0000
@@ -0,0 +1,1 @@
+version("a")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nocompile/version_15.d	Sat Oct 16 16:55:42 2004 +0000
@@ -0,0 +1,2 @@
+version("a"){
+}
--- a/run/sort_02.d	Sat Oct 16 16:54:18 2004 +0000
+++ b/run/sort_02.d	Sat Oct 16 16:55:42 2004 +0000
@@ -1,21 +1,27 @@
 int main(){
 	byte a[];
-	a.length=3;
-	a[0]=3;
-	a[1]=1;
-	a[2]=2;
+	a.length=5;
+	a[0]=byte.max;
+	a[1]=3;
+	a[2]=0;
+	a[3]=2;
+	a[4]=byte.max;
 
 	byte[] b=a.sort;
 
-	assert(a.length==3);
-	assert(a[0]==1);
-	assert(a[1]==2);
-	assert(a[2]==3);
+	assert(a.length==5);
+	assert(a[0]==byte.min);
+	assert(a[1]==0);
+	assert(a[2]==2);
+	assert(a[3]==3);
+	assert(a[4]==byte.max);
 
-	assert(b.length==3);
-	assert(b[0]==1);
-	assert(b[1]==2);
-	assert(b[2]==3);
+	assert(b.length==5);
+	assert(b[0]==byte.min);
+	assert(b[1]==0);
+	assert(b[2]==2);
+	assert(b[3]==3);
+	assert(b[4]==byte.max);
 
 	return 0;
 }
--- a/run/sort_03.d	Sat Oct 16 16:54:18 2004 +0000
+++ b/run/sort_03.d	Sat Oct 16 16:55:42 2004 +0000
@@ -5,27 +5,32 @@
 // @uri@	<ckdc4r$re2$1@digitaldaemon.com>
 
 int main(){
-	real[8] array;
-	array[0]=0.875;
-	array[1]=0.75;
-	array[2]=0.625;
-	array[3]=0.5;
-	array[4]=0.375;
-	array[5]=0.25;
-	array[6]=0.125;
-	array[7]=0.0;
+	real[10] array;
+	array[0]=real.max;
+	array[1]=0.875;
+	array[2]=0.75;
+	array[3]=0.625;
+	array[4]=0.5;
+	array[5]=0.375;
+	array[6]=0.25;
+	array[7]=0.125;
+	array[8]=0.0;
+	array[9]=real.min;
 
 	real[] sorted_copy = array.dup;
 	sorted_copy.sort;
 
-	assert(sorted_copy[0]==0.0);
-	assert(sorted_copy[1]==0.125);
-	assert(sorted_copy[2]==0.25);
-	assert(sorted_copy[3]==0.375);
-	assert(sorted_copy[4]==0.5);
-	assert(sorted_copy[5]==0.625);
-	assert(sorted_copy[6]==0.75);
-	assert(sorted_copy[7]==0.875);
+	assert(sorted_copy.length==10);
+	assert(sorted_copy[0]==real.min);
+	assert(sorted_copy[1]==0.0);
+	assert(sorted_copy[2]==0.125);
+	assert(sorted_copy[3]==0.25);
+	assert(sorted_copy[4]==0.375);
+	assert(sorted_copy[5]==0.5);
+	assert(sorted_copy[6]==0.625);
+	assert(sorted_copy[7]==0.75);
+	assert(sorted_copy[8]==0.875);
+	assert(sorted_copy[9]==real.max);
 
 	return 0;
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/sort_04.d	Sat Oct 16 16:55:42 2004 +0000
@@ -0,0 +1,36 @@
+// based on a report by:
+// @author@	Russ Lewis <spamhole-2001-07-16@deming-os.org>
+// @date@	2004-10-11
+// @url@	nttp://digitalmars.com/digitalmars.D.bugs:2068
+// @uri@	<ckdc4r$re2$1@digitaldaemon.com>
+
+int main(){
+	float[10] array;
+	array[0]=float.max;
+	array[1]=0.875;
+	array[2]=0.75;
+	array[3]=0.625;
+	array[4]=0.5;
+	array[5]=0.375;
+	array[6]=0.25;
+	array[7]=0.125;
+	array[8]=0.0;
+	array[9]=float.min;
+
+	float[] sorted_copy = array.dup;
+	sorted_copy.sort;
+
+	assert(sorted_copy.length==10);
+	assert(sorted_copy[0]==float.min);
+	assert(sorted_copy[1]==0.0);
+	assert(sorted_copy[2]==0.125);
+	assert(sorted_copy[3]==0.25);
+	assert(sorted_copy[4]==0.375);
+	assert(sorted_copy[5]==0.5);
+	assert(sorted_copy[6]==0.625);
+	assert(sorted_copy[7]==0.75);
+	assert(sorted_copy[8]==0.875);
+	assert(sorted_copy[9]==float.max);
+
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/sort_05.d	Sat Oct 16 16:55:42 2004 +0000
@@ -0,0 +1,36 @@
+// based on a report by:
+// @author@	Russ Lewis <spamhole-2001-07-16@deming-os.org>
+// @date@	2004-10-11
+// @url@	nttp://digitalmars.com/digitalmars.D.bugs:2068
+// @uri@	<ckdc4r$re2$1@digitaldaemon.com>
+
+int main(){
+	double[10] array;
+	array[0]=double.max;
+	array[1]=0.875;
+	array[2]=0.75;
+	array[3]=0.625;
+	array[4]=0.5;
+	array[5]=0.375;
+	array[6]=0.25;
+	array[7]=0.125;
+	array[8]=0.0;
+	array[9]=double.min;
+
+	double[] sorted_copy = array.dup;
+	sorted_copy.sort;
+
+	assert(sorted_copy.length==10);
+	assert(sorted_copy[0]==double.min);
+	assert(sorted_copy[1]==0.0);
+	assert(sorted_copy[2]==0.125);
+	assert(sorted_copy[3]==0.25);
+	assert(sorted_copy[4]==0.375);
+	assert(sorted_copy[5]==0.5);
+	assert(sorted_copy[6]==0.625);
+	assert(sorted_copy[7]==0.75);
+	assert(sorted_copy[8]==0.875);
+	assert(sorted_copy[9]==double.max);
+
+	return 0;
+}
--- a/todo.txt	Sat Oct 16 16:54:18 2004 +0000
+++ b/todo.txt	Sat Oct 16 16:55:42 2004 +0000
@@ -11,7 +11,6 @@
 * keyword: const
 * keyword: continue
 * keyword: dchar
-* keyword: debug
 * keyword: delegate
 * keyword: export
 * keyword: extern