# test.coordination/core/predicates/literal.predicate.test.ts

> 16 lines of code and 0 definitions.

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

Listed in [test.coordination/core/predicates](https://banes-lab.com/api/source/testing/test.coordination/core/predicates.md), after [test.coordination/core/predicates/file.predicate.test.ts](https://banes-lab.com/source/testing/test.coordination/core/predicates/file.predicate.test.ts.md) and before [test.coordination/core/predicates/marker.predicate.test.ts](https://banes-lab.com/source/testing/test.coordination/core/predicates/marker.predicate.test.ts.md).

## Contained in

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

## Source

```typescript
import { describe, it } from "vitest";
import assert from "node:assert/strict";
import { stringLiterals } from "coordination-surface/tools/core/predicates/literal.predicate.ts";

describe("stringLiterals", () => {
    it("reads each quoted literal with the line it opens on, across multi-line templates", () => {
        const source = ['const a = "one";', "const b = `two", "lines`;", "const c = 'three';"].join("\n");
        assert.deepEqual(stringLiterals(source), [
            { line: 1, value: "one" },
            { line: 2, value: "two\nlines" },
            { line: 4, value: "three" },
        ]);
    });

    it("reads an empty literal as an empty value", () => {
        assert.deepEqual(stringLiterals('x = ""'), [{ line: 1, value: "" }]);
    });
});
```
