@testable import PureYAML import Testing /// A block scalar's indentation is measured in spaces only; a tab past that indentation is literal /// content, kept verbatim rather than re-expanded to spaces. The surplus whitespace beyond the /// content indentation is reconstructed from the actual leading characters, so a tab stays a tab. @Suite("Block scalar tab content") struct BlockScalarTabContentTests { @Test("A tab after the content indentation is kept literally") func test_tabAfterIndent() throws { #expect(try PureYAML.parse("|\n literal\n \ttext\n") == .string("literal\n\ttext\n")) } @Test("A deeper space indentation still keeps the content tab") func test_tabAfterDeeperIndent() throws { #expect(try PureYAML.parse("|\n literal\n \ttext\n") == .string("literal\n\ttext\n")) } @Test("Surplus spaces beyond the indentation are still preserved as spaces") func test_spaceSurplusUnchanged() throws { #expect(try PureYAML.parse("|\n text\n more\n") == .string("text\n more\n")) } }