@@ -65,6 +65,10 @@ spec = do
6565 it "count mappings with anchor" caseCountMappingsWithAnchor
6666 it "count sequences with custom tag" caseCountSequenceTags
6767 it "count mappings with custom tag" caseCountMappingTags
68+ it "count block style sequences" caseCountBlockStyleSequences
69+ it "count flow style sequences" caseCountFlowStyleSequences
70+ it "count block style mappings" caseCountBlockStyleMappings
71+ it "count flow style mappings" caseCountFlowStyleMappings
6872 it "count aliases" caseCountAliases
6973 it "count scalars" caseCountScalars
7074 it "largest string" caseLargestString
@@ -267,6 +271,38 @@ caseCountSequenceTags =
267271 isCustomTaggedSequence (Y.EventSequenceStart (Y.UriTag "!bar") _ _) = True
268272 isCustomTaggedSequence _ = False
269273
274+caseCountFlowStyleSequences :: Assertion
275+caseCountFlowStyleSequences =
276+ caseHelper yamlString isFlowStyleSequence 1
277+ where
278+ yamlString = "foo: [x, y, z]"
279+ isFlowStyleSequence (Y.EventSequenceStart _ Y.FlowSequence _) = True
280+ isFlowStyleSequence _ = False
281+
282+caseCountBlockStyleSequences :: Assertion
283+caseCountBlockStyleSequences =
284+ caseHelper yamlString isBlockStyleSequence 1
285+ where
286+ yamlString = "foo:\n- x\n- y\n- z\n"
287+ isBlockStyleSequence (Y.EventSequenceStart _ Y.BlockSequence _) = True
288+ isBlockStyleSequence _ = False
289+
290+caseCountFlowStyleMappings :: Assertion
291+caseCountFlowStyleMappings =
292+ caseHelper yamlString isFlowStyleMapping 1
293+ where
294+ yamlString = "foo: { bar: 1, baz: 2 }"
295+ isFlowStyleMapping (Y.EventMappingStart _ Y.FlowMapping _) = True
296+ isFlowStyleMapping _ = False
297+
298+caseCountBlockStyleMappings :: Assertion
299+caseCountBlockStyleMappings =
300+ caseHelper yamlString isBlockStyleMapping 1
301+ where
302+ yamlString = "foo: bar\nbaz: quux"
303+ isBlockStyleMapping (Y.EventMappingStart _ Y.BlockMapping _) = True
304+ isBlockStyleMapping _ = False
305+
270306caseCountScalars :: Assertion
271307caseCountScalars = do
272308 res <- runConduitRes $ Y.decode yamlBS .| CL.fold adder accum