// // 2. Test parsing a simple string and handler // SYMID SyckParseStringHandler( SyckParser *p, SyckNode *n ) { if ( n->kind != syck_str_kind ) return 100; if ( strcmp( syck_str_read( n ), "a_test_string" ) != 0 ) return 200; return 1112; }
// // Test allocating a single node of kind 'str'. // void TestSyckNodeAlloc( CuTest *tc ) { SyckNode* n; n = syck_new_str( "YAML", scalar_plain ); CuAssert( tc, "Allocated 'str' node reporting as 'seq'.", n->kind != syck_seq_kind ); CuAssert( tc, "Allocated 'str' node reporting as 'map'.", n->kind != syck_map_kind ); CuAssert( tc, "Allocated 'str' not reporting as 'str'.", n->kind == syck_str_kind ); CuAssertStrEquals( tc, "YAML", syck_str_read( n ) ); syck_free_node( n ); }