#include <stdio.h>
#include <assert.h>
#include <string.h>

#include "con.h"

int main(void)
{
    printf("CON\n");

    assert(1==1); //this test should succeed
    
    O test1 = fromInt(5);
    assert(5 == toInt(test1));
    assert(0.0d == toFloat(test1));
    assert(0 == toBool(test1));
    assert(strcmp("",toString(test1))==0);
    
    O test2 = fromReal(0.2d);
    assert(0.2d == toReal(test2));
    
    O test3 = fromBool(0);
    assert(0 == toBool(test3));
    
    O test4 = fromString("test");
    assert(strcmp("test",toString(test4)) == 0);

    O testA[4] = {test1, test2, test3, test4};
    O test5 = fromArray(testA);
    assert(memcmp(testA, toArray(test5),sizeof(testA)) == 0);



    printf("all test passed\n");
    return 0;
}
