Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/tests/unit/partition-cell-options.test.ts
6449 views
1
/*
2
* partition-cell-options.test.ts
3
*
4
* Copyright (C) 2020-2023 Posit Software, PBC
5
*
6
*/
7
import { assertEquals } from "testing/asserts";
8
import { breakQuartoMd } from "../../src/core/lib/break-quarto-md.ts";
9
import { partitionCellOptions } from "../../src/core/lib/partition-cell-options.ts";
10
import { initYamlIntelligenceResourcesFromFilesystem } from "../../src/core/schema/utils.ts";
11
import { unitTest } from "../test.ts";
12
import { docs } from "../utils.ts";
13
14
unitTest("partitionCellOptions with two-sided comments", async () => {
15
await initYamlIntelligenceResourcesFromFilesystem();
16
const qmd = Deno.readTextFileSync(
17
docs("partition-cell-options/issue-3901.qmd"),
18
);
19
20
await breakQuartoMd(qmd);
21
assertEquals(
22
partitionCellOptions("c", [
23
"/*| echo: true */",
24
"/*| eval: false */",
25
]).yaml!.echo,
26
true,
27
);
28
});
29
30