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

> 24 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-coordination-core-analyzers-marker-analyzer-test-ts
Source text: https://banes-lab.com/source/testing/test.coordination/core/analyzers/marker.analyzer.test.ts.txt

Listed in [test.coordination/core/analyzers](https://banes-lab.com/api/source/testing/test.coordination/core/analyzers.md), after [test.coordination/core/analyzers/literal.analyzer.test.ts](https://banes-lab.com/source/testing/test.coordination/core/analyzers/literal.analyzer.test.ts.md) and before [test.coordination/core/analyzers/snapshot.analyzer.test.ts](https://banes-lab.com/source/testing/test.coordination/core/analyzers/snapshot.analyzer.test.ts.md).

## Contained in

- [test.coordination/core/analyzers](https://banes-lab.com/anatomy/testing/folder-testing-test-coordination-core-analyzers.md)

## Source

```typescript
import { carriesMarker, repeatedSpan } from "coordination-surface/tools/core/analyzers/marker.analyzer.ts";
import { describe, it } from "vitest";
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);
    });
});
```
