@@ -9,154 +9,8 @@ namespace c4 {
99namespace yml {
1010
1111
12- static constexpr const bool multiline = true ;
1312static constexpr const bool singleline = false ;
1413
15- // -----------------------------------------------------------------------------
16-
17- ENGINE_TEST (SimpleSeqFlow,
18- " [foo,bar,baz]"
19- ,
20- " +STR\n "
21- " +DOC\n "
22- " +SEQ []\n "
23- " =VAL :foo\n "
24- " =VAL :bar\n "
25- " =VAL :baz\n "
26- " -SEQ\n "
27- " -DOC\n "
28- " -STR\n " )
29- {
30- ___ (ps.begin_stream ());
31- ___ (ps.begin_doc ());
32- ___ (ps.begin_seq_val_flow ());
33- ___ (ps.set_val_scalar_plain (" foo" ));
34- ___ (ps.add_sibling ());
35- ___ (ps.set_val_scalar_plain (" bar" ));
36- ___ (ps.add_sibling ());
37- ___ (ps.set_val_scalar_plain (" baz" ));
38- ___ (ps.end_seq_flow (singleline));
39- ___ (ps.end_doc ());
40- ___ (ps.end_stream ());
41- }
42-
43-
44- ENGINE_TEST_ERRLOC (SimpleSeqFlowErr0, Location(1 ,1 ,2 ), " [" )
45- ENGINE_TEST_ERRLOC (SimpleSeqFlowErr1, Location(2 ,1 ,3 ), " [[" )
46- ENGINE_TEST_ERRLOC (SimpleSeqFlowErr2, Location(3 ,1 ,4 ), " [[]" )
47- ENGINE_TEST_ERRLOC (SimpleSeqFlowErr3, Location(5 ,1 ,6 ), " [[[]]" )
48- ENGINE_TEST_ERRLOC (SimpleSeqFlowErr4, Location(4 ,1 ,5 ), " [foo" )
49- ENGINE_TEST_ERRLOC (SimpleSeqFlowErr5, Location(5 ,1 ,6 ), " [foo," )
50- ENGINE_TEST_ERRLOC (SimpleSeqFlowErr6, Location(12 ,1 ,13 ), " [foo,bar,baz" )
51- ENGINE_TEST_ERRLOC (SimpleSeqFlowErr7, Location(8 ,1 ,9 ), " [[a,b,c]" )
52-
53-
54- ENGINE_TEST (NestedSeqFlowEmpty,
55- " [[]]"
56- ,
57- " +STR\n "
58- " +DOC\n "
59- " +SEQ []\n "
60- " +SEQ []\n "
61- " -SEQ\n "
62- " -SEQ\n "
63- " -DOC\n "
64- " -STR\n " )
65- {
66- ___ (ps.begin_stream ());
67- ___ (ps.begin_doc ());
68- ___ (ps.begin_seq_val_flow ());
69- ___ (ps.begin_seq_val_flow ());
70- ___ (ps.end_seq_flow (singleline));
71- ___ (ps.end_seq_flow (singleline));
72- ___ (ps.end_doc ());
73- ___ (ps.end_stream ());
74- }
75-
76- ENGINE_TEST (NestedSeq3FlowEmpty,
77- " [[[]]]"
78- ,
79- " +STR\n "
80- " +DOC\n "
81- " +SEQ []\n "
82- " +SEQ []\n "
83- " +SEQ []\n "
84- " -SEQ\n "
85- " -SEQ\n "
86- " -SEQ\n "
87- " -DOC\n "
88- " -STR\n " )
89- {
90- ___ (ps.begin_stream ());
91- ___ (ps.begin_doc ());
92- ___ (ps.begin_seq_val_flow ());
93- ___ (ps.begin_seq_val_flow ());
94- ___ (ps.begin_seq_val_flow ());
95- ___ (ps.end_seq_flow (singleline));
96- ___ (ps.end_seq_flow (singleline));
97- ___ (ps.end_seq_flow (singleline));
98- ___ (ps.end_doc ());
99- ___ (ps.end_stream ());
100- }
101-
102- ENGINE_TEST (NestedSeq4FlowEmpty,
103- " [[[[]]]]"
104- ,
105- " +STR\n "
106- " +DOC\n "
107- " +SEQ []\n "
108- " +SEQ []\n "
109- " +SEQ []\n "
110- " +SEQ []\n "
111- " -SEQ\n "
112- " -SEQ\n "
113- " -SEQ\n "
114- " -SEQ\n "
115- " -DOC\n "
116- " -STR\n " )
117- {
118- ___ (ps.begin_stream ());
119- ___ (ps.begin_doc ());
120- ___ (ps.begin_seq_val_flow ());
121- ___ (ps.begin_seq_val_flow ());
122- ___ (ps.begin_seq_val_flow ());
123- ___ (ps.begin_seq_val_flow ());
124- ___ (ps.end_seq_flow (singleline));
125- ___ (ps.end_seq_flow (singleline));
126- ___ (ps.end_seq_flow (singleline));
127- ___ (ps.end_seq_flow (singleline));
128- ___ (ps.end_doc ());
129- ___ (ps.end_stream ());
130- }
131-
132- ENGINE_TEST (SimpleSeqFlowMultiline,
133- " [\n foo\n ,\n bar\n ,\n baz\n ]"
134- ,
135- " [\n foo,\n bar,\n baz\n ]\n "
136- ,
137- " +STR\n "
138- " +DOC\n "
139- " +SEQ []\n "
140- " =VAL :foo\n "
141- " =VAL :bar\n "
142- " =VAL :baz\n "
143- " -SEQ\n "
144- " -DOC\n "
145- " -STR\n " )
146- {
147- ___ (ps.begin_stream ());
148- ___ (ps.begin_doc ());
149- ___ (ps.begin_seq_val_flow ());
150- ___ (ps.set_val_scalar_plain (" foo" ));
151- ___ (ps.add_sibling ());
152- ___ (ps.set_val_scalar_plain (" bar" ));
153- ___ (ps.add_sibling ());
154- ___ (ps.set_val_scalar_plain (" baz" ));
155- ___ (ps.end_seq_flow (multiline));
156- ___ (ps.end_doc ());
157- ___ (ps.end_stream ());
158- }
159-
16014
16115// -----------------------------------------------------------------------------
16216
@@ -431,51 +285,6 @@ ENGINE_TEST(SimpleSeqBlockEmptyFolded,
431285
432286// -----------------------------------------------------------------------------
433287
434- ENGINE_TEST (SeqSeqFlow,
435- " [[foo1,bar1,baz1],\n [foo2,bar2,baz2]]"
436- ,
437- " [\n [foo1,bar1,baz1],\n [foo2,bar2,baz2]\n ]\n "
438- ,
439- " +STR\n "
440- " +DOC\n "
441- " +SEQ []\n "
442- " +SEQ []\n "
443- " =VAL :foo1\n "
444- " =VAL :bar1\n "
445- " =VAL :baz1\n "
446- " -SEQ\n "
447- " +SEQ []\n "
448- " =VAL :foo2\n "
449- " =VAL :bar2\n "
450- " =VAL :baz2\n "
451- " -SEQ\n "
452- " -SEQ\n "
453- " -DOC\n "
454- " -STR\n " )
455- {
456- ___ (ps.begin_stream ());
457- ___ (ps.begin_doc ());
458- ___ (ps.begin_seq_val_flow ());
459- ___ (ps.begin_seq_val_flow ());
460- ___ (ps.set_val_scalar_plain (" foo1" ));
461- ___ (ps.add_sibling ());
462- ___ (ps.set_val_scalar_plain (" bar1" ));
463- ___ (ps.add_sibling ());
464- ___ (ps.set_val_scalar_plain (" baz1" ));
465- ___ (ps.end_seq_flow (singleline));
466- ___ (ps.add_sibling ());
467- ___ (ps.begin_seq_val_flow ());
468- ___ (ps.set_val_scalar_plain (" foo2" ));
469- ___ (ps.add_sibling ());
470- ___ (ps.set_val_scalar_plain (" bar2" ));
471- ___ (ps.add_sibling ());
472- ___ (ps.set_val_scalar_plain (" baz2" ));
473- ___ (ps.end_seq_flow (singleline));
474- ___ (ps.end_seq_flow (multiline));
475- ___ (ps.end_doc ());
476- ___ (ps.end_stream ());
477- }
478-
479288
480289ENGINE_TEST (SeqBlockSpace, HAS_MULTILINE_SCALAR,
481290 " "
@@ -530,36 +339,6 @@ ENGINE_TEST(SeqBlockTab, HAS_MULTILINE_SCALAR,
530339#endif
531340
532341
533- // -----------------------------------------------------------------------------
534-
535- ENGINE_TEST_ERRLOC (SeqFlowCommentAfterComma, Location(6 ,1 ,7 ), " [a, b,#c\n ]" )
536-
537- ENGINE_TEST (SeqFlowCommentAfterCommaWhitespace,
538- " [a, b, #c\n ]"
539- ,
540- " [\n a,\n b\n ]\n "
541- ,
542- " +STR\n "
543- " +DOC\n "
544- " +SEQ []\n "
545- " =VAL :a\n "
546- " =VAL :b\n "
547- " -SEQ\n "
548- " -DOC\n "
549- " -STR\n " )
550- {
551- ___ (ps.begin_stream ());
552- ___ (ps.begin_doc ());
553- ___ (ps.begin_map_val_flow ());
554- ___ (ps.set_key_scalar_plain (" a" ));
555- ___ (ps.add_sibling ());
556- ___ (ps.set_val_scalar_plain (" b" ));
557- ___ (ps.end_map_flow (multiline));
558- ___ (ps.end_doc ());
559- ___ (ps.end_stream ());
560- }
561-
562-
563342// -----------------------------------------------------------------------------
564343
565344ENGINE_TEST (SeqSeqBlock,
@@ -794,64 +573,6 @@ ENGINE_TEST(SeqMapBlock,
794573 ___ (ps.end_stream ());
795574}
796575
797-
798- // -----------------------------------------------------------------------------
799-
800- ENGINE_TEST_ERRLOC (tokens_after_seqflow_0_0, Location(1 ,32 ), " [a,b,c, d]foo" )
801- ENGINE_TEST_ERRLOC (tokens_after_seqflow_0_1, Location(2 , 4 ), " [a,b,c, d]\n foo" )
802- ENGINE_TEST_ERRLOC (tokens_after_seqflow_2_0, Location(1 ,29 ), " [a,b,c, d]- foo" )
803- ENGINE_TEST_ERRLOC (tokens_after_seqflow_2_1, Location(2 , 1 ), " [a,b,c, d]\n - foo" )
804- ENGINE_TEST_ERRLOC (tokens_after_seqflow_3_0, Location(1 ,29 ), " [a,b,c, d][foo,bar]" )
805- ENGINE_TEST_ERRLOC (tokens_after_seqflow_3_1, Location(2 , 1 ), " [a,b,c, d]\n [foo,bar]" )
806- ENGINE_TEST_ERRLOC (tokens_after_seqflow_4_0, Location(1 ,29 ), " [a,b,c, d]{foo: bar}" )
807- ENGINE_TEST_ERRLOC (tokens_after_seqflow_4_1, Location(2 , 1 ), " [a,b,c, d]\n {foo: bar}" )
808- ENGINE_TEST_ERRLOC (tokens_after_seqflow_5_0, Location(1 ,29 ), " [a,b,c, d]'foo'" )
809- ENGINE_TEST_ERRLOC (tokens_after_seqflow_5_1, Location(2 , 1 ), " [a,b,c, d]\n 'foo'" )
810- ENGINE_TEST_ERRLOC (tokens_after_seqflow_6_0, Location(1 ,29 ), " [a,b,c, d]|\n foo" )
811- ENGINE_TEST_ERRLOC (tokens_after_seqflow_6_1, Location(2 , 1 ), " [a,b,c, d]\n |\n foo" )
812- ENGINE_TEST_ERRLOC (tokens_after_seqflow_7_0, Location(1 ,29 ), " [a,b,c, d]>\n foo" )
813- ENGINE_TEST_ERRLOC (tokens_after_seqflow_7_1, Location(2 , 1 ), " [a,b,c, d]\n >\n foo" )
814- ENGINE_TEST_ERRLOC (tokens_after_seqflow_8_0, Location(1 ,33 ), " [a,b,c, d]?foo" )
815- ENGINE_TEST_ERRLOC (tokens_after_seqflow_8_1, Location(2 , 1 ), " [a,b,c, d]\n ?\n foo" )
816- ENGINE_TEST_ERRLOC (tokens_after_seqflow_9_0, Location(1 ,33 ), " [a,b,c, d]:foo" )
817- ENGINE_TEST_ERRLOC (tokens_after_seqflow_9_1, Location(2 , 1 ), " [a,b,c, d]\n :\n foo" )
818- ENGINE_TEST_ERRLOC (tokens_after_seqflow_10_0, Location(2 , 1 ), " [a,b,c, d]\n : foo" )
819- ENGINE_TEST_ERRLOC (tokens_after_seqflow_10_1, Location(2 , 1 ), " [a,b,c, d]\n : \n foo" )
820- ENGINE_TEST_ERRLOC (tokens_after_seqflow_11_0, Location(1 ,34 ), " [a,b,c, d] &foo" )
821- ENGINE_TEST_ERRLOC (tokens_after_seqflow_11_1, Location(2 , 5 ), " [a,b,c, d]\n &foo" )
822-
823- ENGINE_TEST_ERRLOC (ExtraTokensFlow1Seq1, Location(1 , 9 ), " [a,b,c]]" )
824- ENGINE_TEST_ERRLOC (ExtraTokensFlow1Seq2, Location(1 , 9 ), " [a,b,c]}" )
825- ENGINE_TEST_ERRLOC (ExtraTokensFlow1Seq3, Location(1 , 8 ), " [a,b,c]{" )
826- ENGINE_TEST_ERRLOC (ExtraTokensFlow1Seq4, Location(1 , 8 ), " [a,b,c][" )
827- ENGINE_TEST_ERRLOC (ExtraTokensFlow1Seq5, Location(1 , 8 ), " [a,b,c]-" )
828- ENGINE_TEST_ERRLOC (ExtraTokensFlow1Seq1_0, Location(1 ,10 ), " [a,b,c] ]" )
829- ENGINE_TEST_ERRLOC (ExtraTokensFlow1Seq2_0, Location(1 ,10 ), " [a,b,c] }" )
830- ENGINE_TEST_ERRLOC (ExtraTokensFlow1Seq3_0, Location(1 ,9 ), " [a,b,c] {" )
831- ENGINE_TEST_ERRLOC (ExtraTokensFlow1Seq4_0, Location(1 ,9 ), " [a,b,c] [" )
832- ENGINE_TEST_ERRLOC (ExtraTokensFlow1Seq5_0, Location(1 ,9 ), " [a,b,c] -" )
833- ENGINE_TEST_ERRLOC (ExtraTokensFlow1Seq1_1, Location(2 ,2 ), " [a,b,c]\n ]" )
834- ENGINE_TEST_ERRLOC (ExtraTokensFlow1Seq2_1, Location(2 ,2 ), " [a,b,c]\n }" )
835- ENGINE_TEST_ERRLOC (ExtraTokensFlow1Seq3_1, Location(2 ,1 ), " [a,b,c]\n {" )
836- ENGINE_TEST_ERRLOC (ExtraTokensFlow1Seq4_1, Location(2 ,1 ), " [a,b,c]\n [" )
837- ENGINE_TEST_ERRLOC (ExtraTokensFlow1Seq5_1, Location(2 ,1 ), " [a,b,c]\n -" )
838-
839- ENGINE_TEST_ERRLOC (ExtraTokensFlow2Seq1, Location(2 , 9 ), " ---\n [a,b,c]]" )
840- ENGINE_TEST_ERRLOC (ExtraTokensFlow2Seq2, Location(2 , 9 ), " ---\n [a,b,c]}" )
841- ENGINE_TEST_ERRLOC (ExtraTokensFlow2Seq3, Location(2 , 8 ), " ---\n [a,b,c]{" )
842- ENGINE_TEST_ERRLOC (ExtraTokensFlow2Seq4, Location(2 , 8 ), " ---\n [a,b,c][" )
843- ENGINE_TEST_ERRLOC (ExtraTokensFlow2Seq5, Location(2 , 8 ), " ---\n [a,b,c]-" )
844- ENGINE_TEST_ERRLOC (ExtraTokensFlow2Seq1_0, Location(2 ,10 ), " ---\n [a,b,c] ]" )
845- ENGINE_TEST_ERRLOC (ExtraTokensFlow2Seq2_0, Location(2 ,10 ), " ---\n [a,b,c] }" )
846- ENGINE_TEST_ERRLOC (ExtraTokensFlow2Seq3_0, Location(2 ,9 ), " ---\n [a,b,c] {" )
847- ENGINE_TEST_ERRLOC (ExtraTokensFlow2Seq4_0, Location(2 ,9 ), " ---\n [a,b,c] [" )
848- ENGINE_TEST_ERRLOC (ExtraTokensFlow2Seq5_0, Location(2 ,9 ), " ---\n [a,b,c] -" )
849- ENGINE_TEST_ERRLOC (ExtraTokensFlow2Seq1_1, Location(3 ,2 ), " ---\n [a,b,c]\n ]" )
850- ENGINE_TEST_ERRLOC (ExtraTokensFlow2Seq2_1, Location(3 ,2 ), " ---\n [a,b,c]\n }" )
851- ENGINE_TEST_ERRLOC (ExtraTokensFlow2Seq3_1, Location(3 ,1 ), " ---\n [a,b,c]\n {" )
852- ENGINE_TEST_ERRLOC (ExtraTokensFlow2Seq4_1, Location(3 ,1 ), " ---\n [a,b,c]\n [" )
853- ENGINE_TEST_ERRLOC (ExtraTokensFlow2Seq5_1, Location(3 ,1 ), " ---\n [a,b,c]\n -" )
854-
855576} // namespace yml
856577} // namespace c4
857578
0 commit comments