@testable import PureYAML import Testing @Suite("A block entry after a flow collection") struct BlockEntryAfterFlowTests { @Test("A block entry on the same line as a closed flow collection is rejected", arguments: [ "---\n- { y: z }- invalid\n", // a block entry after a flow mapping "- [a] - b\n", // a block entry after a flow sequence ]) func test_blockEntryAfterFlowRejected(_ yaml: String) throws { #expect(throws: PureYAML.Parsing.ParseError.self) { try PureYAML.parse(yaml) } } @Test("Nested entries and flow collections on their own line stay valid", arguments: [ "- - a\n- - b\n", // a nested block sequence "- [a]\n- [b]\n", // flow sequences, each on its own line "- {a: b}\n- c\n", // a flow mapping item then a sibling entry "[[a], [b]]\n", // nested flow sequences ]) func test_validBlockAndFlowEntries(_ yaml: String) throws { _ = try PureYAML.parse(yaml) } }