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

> 23 lines of code and 0 definitions.

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

## Source

```typescript
import { at, endOfQuoted, isAttribution } from "../../../tools/core/predicates/comment.predicate.ts";
import { describe, it } from "node:test";
import assert from "node:assert/strict";

describe("at", () => {
    it("reads the character at an index, or nothing past the end", () => {
        assert.equal(at("abc", 1), "b");
        assert.equal(at("abc", 5), "");
    });
});

describe("isAttribution", () => {
    it("recognizes a license or copyright line and nothing else", () => {
        assert.equal(isAttribution("// SPDX-License-Identifier: MIT"), true);
        assert.equal(isAttribution("// Copyright 2026"), true);
        assert.equal(isAttribution("// reads the board"), false);
    });
});

describe("endOfQuoted", () => {
    it("returns the index after the closing quote, stepping over escaped quotes", () => {
        const source = String.raw`"a\"b" rest`;
        assert.equal(endOfQuoted(source, 1, '"'), 6);
        assert.equal(endOfQuoted('"open', 1, '"'), 5);
    });
});
```
