Ejemplo n.º 1
0
TEST( TESTNAME , test2 )
{
    auto t = canonic_test_trees::test_tree8();
    
    auto rule = gpcxx::make_summarize_constant( []( double t ) {
        return node_type::make_constant_terminal( gpcxx::double_terminal< double >( t ) , std::to_string( t ) ); } );
    rule_container rules { rule };
    gpcxx::transform_tree( rules , t );

    EXPECT_EQ( t.size() , size_t { 3 } );
    test_cursor( t.root() , "+" , 2 , 2 , 0 );
    test_cursor( t.root().children(0) , "x" , 0 , 1 , 1 );
    test_cursor( t.root().children(1) , "0.841471" , 0 , 1 , 1 );
}
Ejemplo n.º 2
0
TEST( TESTNAME , test1 )
{
    auto t = canonic_test_trees::test_tree1();
    
    algebras_type algebras { };
    algebras.add_abelian_magma( node_type::make_binary_operation( gpcxx::plus_func {} , "+" ) );
    
    rule_container rules { gpcxx::make_sort_commutative( algebras ) };
    gpcxx::transform_tree( rules , t );
    
    EXPECT_EQ( t.size() , size_t( 3 ) );
    test_cursor( t.root() , "+" , 2 , 2 , 0 );
    test_cursor( t.root().children(0) , "x" , 0 , 1 , 1 );
    test_cursor( t.root().children(1) , "y" , 0 , 1 , 1 );
}
Ejemplo n.º 3
0
int main() {
  test_table();
  test_rows();
  test_bitmap();
  test_int_key();
  test_text_key();
  test_cursor();
  test_reference();
  return 0;
}
Ejemplo n.º 4
0
TEST( TESTNAME , test1 )
{
    auto t = canonic_test_trees::test_tree3();
    
    algebras_type algebras {};
    algebras.add_abelian_group( group_type {
        node_type::make_binary_operation( gpcxx::plus_func {} , "+" ) ,
        node_type::make_constant_terminal( gpcxx::double_terminal<> { 0.0 } , "0" ) ,
        node_type::make_binary_operation( gpcxx::minus_func {} , "-" ) ,
        node_type::make_identity_operation( gpcxx::unary_minus_func {} , "um" )
        } );
    
    rule_container rules { gpcxx::make_left_lift( algebras ) };
    gpcxx::transform_tree( rules , t );
    
    EXPECT_EQ( t.size() , size_t( 4 ) );
    test_cursor( t.root() , "+" , 3 , 2 , 0 );
    test_cursor( t.root().children(0) , "z" , 0 , 1 , 1 );
    test_cursor( t.root().children(1) , "y" , 0 , 1 , 1 );
    test_cursor( t.root().children(2) , "x" , 0 , 1 , 1 );
}
Ejemplo n.º 5
0
int main(int argc, const char *argv[]) {
  program_name = argv[0];

  (void) argc;

  test_card();
  test_cursor();
  test_deck();
  test_gui();
  test_frame();
  test_game();
  test_keyboard();
  test_stack();
  test_test_helper();

  return(0);
}