# tests/core/analyzers/marker.analyzer.test.ts

> 24 lines of code and 0 definitions.

Tree: Coordination tree
Language: typescript
Canonical: https://banes-lab.com/anatomy/coordination#file-coordination-tests-core-analyzers-marker-analyzer-test-ts
Source text: https://banes-lab.com/assets/sources/source.3097ff395fb083cd5743da685aeaf96e4a2b196edd45b9ff66846e284e6797e8.generated.txt

## Source

```typescript
import { carriesMarker, repeatedSpan } from "../../../tools/core/analyzers/marker.analyzer.ts";
import { describe, it } from "node:test";
import assert from "node:assert/strict";

describe("repeatedSpan", () => {
    it("returns the first run of words that appears twice, ignoring case and punctuation", () => {
        assert.equal(repeatedSpan("The gate holds. Later, the GATE HOLDS again.", 3), "the gate holds");
    });

    it("returns null when the text is too short or no run repeats", () => {
        assert.equal(repeatedSpan("one two", 2), null);
        assert.equal(repeatedSpan("one two three four five six", 2), null);
    });
});

describe("carriesMarker", () => {
    it("finds a marker that stands alone and ends its clause", () => {
        assert.equal(carriesMarker("Status: DONE", "DONE"), true);
        assert.equal(carriesMarker("marked DONE, then moved", "DONE"), true);
    });

    it("ignores a marker inside a word, joined by a hyphen, in balanced quotes, or followed by more words", () => {
        assert.equal(carriesMarker("UNDONE work", "DONE"), false);
        assert.equal(carriesMarker("half-DONE", "DONE"), false);
        assert.equal(carriesMarker("the `DONE` marker", "DONE"), false);
        assert.equal(carriesMarker("DONE with the draft", "DONE"), false);
    });
});
```
