Permalink
Browse files

moved check to erb file and regenerated test

  • Loading branch information...
1 parent 5811297 commit 84c7984059664f880da072276b13b0201cc61d0b @indeyets committed Apr 27, 2008
Showing with 24 additions and 14 deletions.
  1. +20 −13 tests/YTS.c
  2. +4 −1 tests/YTS.c.erb
View
@@ -281,21 +281,28 @@ void CuRoundTrip( CuTest* tc, struct test_node *stream ) {
void
YtsFoldedScalars_7( CuTest *tc )
{
- struct test_node map[] = {
- { T_STR, 0, "a" },
- { T_STR, 0, "b" },
- end_node
- };
-
- struct test_node stream[] = {
- { T_MAP, 0, 0, map },
- end_node
- };
-
- CuStreamCompare( tc, "a: b\t \n", stream );
+struct test_node map[] = {
+ { T_STR, 0, "a" },
+ { T_STR, 0, "b" },
+ end_node
+};
+struct test_node stream[] = {
+ { T_MAP, 0, 0, map },
+ end_node
+};
+
+ CuStreamCompare( tc,
+
+ /* YAML document */
+"a: b\t \n"
+ ,
+
+ /* C structure of validations */
+ stream
+ );
+
CuRoundTrip( tc, stream );
}
-
/*
* Example : Empty Sequence
*/
View
@@ -158,7 +158,10 @@ void CuStreamCompare( CuTest* tc, char *yaml, struct test_node *stream ) {
if ( parser->eof == 1 ) break;
/* Add document to stream */
- syck_lookup_sym( parser, oid, (char **)&ydoc );
+ int res = syck_lookup_sym( parser, oid, (char **)&ydoc );
+ if (0 == res)
+ break;
+
ystream[doc_ct] = ydoc[0];
doc_ct++;
S_REALLOC_N( ystream, struct test_node, doc_ct + 1 );

0 comments on commit 84c7984

Please sign in to comment.