# tests/core/predicates/fence.predicate.test.ts

> 16 lines of code and 0 definitions.

Tree: Coordination tree
Language: typescript
Canonical: https://banes-lab.com/anatomy/coordination#file-coordination-tests-core-predicates-fence-predicate-test-ts
Source text: https://banes-lab.com/assets/sources/source.1406fcc56876874f3eb78af30f3206c7fbf39138dd89c718ff2cc32a7254d105.generated.txt

## Source

`````typescript
import { describe, it } from "node:test";
import assert from "node:assert/strict";
import { fencedFlags } from "../../../tools/core/predicates/fence.predicate.ts";

describe("fencedFlags", () => {
    it("flags the lines from an opening fence through its closing fence", () => {
        const source = ["prose", "```ts", "code", "```", "after"].join("\n");
        assert.deepEqual(fencedFlags(source), [false, true, true, true, false]);
    });

    it("keeps a fence open past a shorter run or a run followed by text", () => {
        const source = ["````", "```", "``` not a close", "````  ", "after"].join("\n");
        assert.deepEqual(fencedFlags(source), [true, true, true, true, false]);
    });

    it("does not open a fence on a run shorter than three", () => {
        assert.deepEqual(fencedFlags("``inline``\nprose"), [false, false]);
    });
});
`````
