@testable import PureYAML import Testing @Suite("A block sequence after a node property") struct BlockSequenceAfterPropertyTests { @Test("A block sequence on the same line as its anchor or tag is rejected", arguments: [ "&anchor - sequence entry\n", // an anchor immediately before a block entry "!!seq - x\n", // a tag immediately before a block entry ]) func test_inlineBlockSequenceAfterPropertyRejected(_ yaml: String) throws { #expect(throws: PureYAML.Parsing.ParseError.self) { try PureYAML.parse(yaml) } } @Test("Properties positioned correctly around a sequence stay valid", arguments: [ "&anchor\n- a\n- b\n", // the anchor on its own line, sequence below "- &anchor x\n- y\n", // the anchor inside a sequence item "&anchor [a, b]\n", // a flow sequence may follow an anchor inline "key: &anchor\n - a\n - b\n", // the anchor then an indented sequence "&anchor value\n", // a scalar may follow an anchor inline ]) func test_validSequencePropertyPlacement(_ yaml: String) throws { _ = try PureYAML.parse(yaml) } }