@testable import PureYAML import Testing @Suite("Empty tagged and anchored nodes") struct EmptyTaggedNodeTests { @Test("A tag with no following node tags an empty node") func test_emptyTaggedNode() throws { #expect(try PureYAML.parse("x: !!str\n") == .mapping(.init([.init(key: "x", value: .string(""))]))) #expect(try PureYAML.parse("x: !!null\n") == .mapping(.init([.init(key: "x", value: .null)]))) } @Test("A tagged empty node works as the final sequence item") func test_emptyTaggedSequenceItem() throws { #expect(try PureYAML.parse("- a\n- !!str\n") == .sequence(.init([.string("a"), .string("")]))) } @Test("A real tagged value is unaffected") func test_taggedValueUnaffected() throws { #expect(try PureYAML.parse("x: !!str hello\n") == .mapping(.init([.init(key: "x", value: .string("hello"))]))) } }