Changeset 314 for trunk

Show
Ignore:
Timestamp:
04/27/2008 13:16:45 (7 months ago)
Author:
indeyets
Message:

moved check to erb file and regenerated test

Location:
trunk/tests
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/YTS.c

    r310 r314  
    282282YtsFoldedScalars_7( CuTest *tc ) 
    283283{ 
    284     struct test_node map[] = { 
    285         { T_STR, 0, "a" }, 
    286         { T_STR, 0, "b" }, 
    287         end_node 
    288     }; 
    289  
    290     struct test_node stream[] = { 
    291         { T_MAP, 0, 0, map }, 
    292         end_node 
    293     }; 
    294  
    295     CuStreamCompare( tc, "a: b\t  \n", stream ); 
    296     CuRoundTrip( tc, stream ); 
    297 } 
    298  
     284struct test_node map[] = { 
     285    { T_STR, 0, "a" }, 
     286    { T_STR, 0, "b" }, 
     287    end_node 
     288}; 
     289struct test_node stream[] = { 
     290    { T_MAP, 0, 0, map }, 
     291    end_node 
     292}; 
     293 
     294    CuStreamCompare( tc, 
     295 
     296        /* YAML document */  
     297"a: b\t  \n" 
     298        , 
     299 
     300        /* C structure of validations */ 
     301        stream 
     302    ); 
     303 
     304    CuRoundTrip( tc, stream ); 
     305} 
    299306/* 
    300307 * Example : Empty Sequence 
  • trunk/tests/YTS.c.erb

    r225 r314  
    159159 
    160160        /* Add document to stream */ 
    161         syck_lookup_sym( parser, oid, (char **)&ydoc ); 
     161        int res = syck_lookup_sym( parser, oid, (char **)&ydoc ); 
     162        if (0 == res) 
     163            break; 
     164 
    162165        ystream[doc_ct] = ydoc[0]; 
    163166        doc_ct++;