Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/tests/smoke/yaml/yaml-cr-line-endings.test.ts
6569 views
1
/*
2
* yaml-cr-line-endings.test.ts
3
*
4
* Test YAML validation with CR-only line endings (old Mac format)
5
* See: https://github.com/quarto-dev/quarto-cli/issues/13998
6
*
7
* Copyright (C) 2025 Posit Software, PBC
8
*/
9
10
import { testRender } from "../render/render.ts";
11
import { noErrorsOrWarnings } from "../../verify.ts";
12
import { join } from "../../../src/deno_ral/path.ts";
13
14
// Create test file with CR-only line endings programmatically
15
const dir = Deno.makeTempDirSync({ prefix: "quarto-cr-test-" });
16
const crContent = "---\rtitle: \"CR Test\"\rauthor: \"Test Author\"\r---\r\rContent here.\r";
17
const inputFile = join(dir, "cr-only.qmd");
18
Deno.writeFileSync(inputFile, new TextEncoder().encode(crContent));
19
20
testRender(inputFile, "html", false, [noErrorsOrWarnings], {
21
teardown: async () => {
22
Deno.removeSync(dir, { recursive: true });
23
},
24
});
25
26