Commit 6a313c7b authored by dcw's avatar dcw

added length tests

parent 1d6b9ae4
......@@ -7,14 +7,17 @@ intlist int1, int2, int3;
test_intlist()
{
int1 = intlist_null();
int1 = intlist_nil();
int2 = intlist_cons( 11, int1 );
int3 = intlist_cons( 20, int2 );
printf( "intlists:\n" );
printf( "\n int1: " ); print_intlist( stdout, int1 );
printf( "\n int2: " ); print_intlist( stdout, int2 );
printf( "\n int3: " ); print_intlist( stdout, int3 );
printf( "\n int1: len %d, ", length(int1) );
print_intlist( stdout, int1 );
printf( "\n int2: len %d, ", length(int2) );
print_intlist( stdout, int2 );
printf( "\n int3: len %d, ", length(int3) );
print_intlist( stdout, int3 );
printf( "\n\n" );
}
......@@ -23,16 +26,16 @@ test_illist()
{
illist il1, il2, il3, il4;
il1 = illist_null();
il1 = illist_nil();
il2 = illist_cons( int1, il1 );
il3 = illist_cons( int2, il2 );
il4 = illist_cons( int3, il3 );
printf( "illists:\n" );
printf( "\n il1: " ); print_illist( stdout, il1 );
printf( "\n il2: " ); print_illist( stdout, il2 );
printf( "\n il3: " ); print_illist( stdout, il3 );
printf( "\n il4: " ); print_illist( stdout, il4 );
printf( "\n il1: len %d, ", length(il1) ); print_illist( stdout, il1 );
printf( "\n il2: len %d, ", length(il2) ); print_illist( stdout, il2 );
printf( "\n il3: len %d, ", length(il2) ); print_illist( stdout, il3 );
printf( "\n il4: len %d, ", length(il2) ); print_illist( stdout, il4 );
printf( "\n\n" );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment