Commit 83176e62 authored by dcw's avatar dcw
Browse files

Initial revision

parent 4ec2c28c
#include <dcw.h>
#include "x.h"
intlist int1, int2, int3;
test_intlist()
{
int1 = intlist_null();
int2 = intlist_cons( 10, 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\n" );
}
test_illist()
{
illist il1, il2, il3, il4;
il1 = illist_null();
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\n" );
}
test_idtree()
{
idtree id1, id2, id3, id4, id5, id6;
id1 = idtree_leaf( "hello" );
id2 = idtree_leaf( "there" );
id3 = idtree_node( id1, id2 );
id4 = idtree_node( id3, id1 );
id5 = idtree_leaf( "zebedee" );
id6 = idtree_node( id4, id5 );
printf( "idtrees:\n" );
printf( "\n id1: " );
print_idtree( stdout, id1 );
printf( "\n id2: " );
print_idtree( stdout, id2 );
printf( "\n id3: " );
print_idtree( stdout, id3 );
printf( "\n id4: " );
print_idtree( stdout, id4 );
printf( "\n id5: " );
print_idtree( stdout, id5 );
printf( "\n id6: " );
print_idtree( stdout, id6 );
printf( "\n\n" );
}
main()
{
test_intlist();
test_illist();
test_idtree();
}
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