Skip to content

Commit 3fbb030

Browse files
committed
Keep Postgres-specific E'' string tests out of shared string tests
1 parent 069f0d9 commit 3fbb030

File tree

2 files changed

+2
-28
lines changed

2 files changed

+2
-28
lines changed

test/features/strings.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ type StringType =
1212
| "''-bs" // with backslash escaping
1313
| "U&''" // with repeated-quote escaping
1414
| "N''" // with escaping style depending on whether also ''-qq or ''-bs was specified
15-
| "E''" // with escaping style depending on whether also ''-qq or ''-bs was specified
1615
| "X''" // no escaping
1716
| 'X""' // no escaping
1817
| "B''" // no escaping
@@ -140,32 +139,6 @@ export default function supportsStrings(format: FormatFn, stringTypes: StringTyp
140139
});
141140
}
142141

143-
if (stringTypes.includes("E''")) {
144-
it('supports unicode strings', () => {
145-
expect(format("SELECT E'where' FROM E'update'")).toBe(dedent`
146-
SELECT
147-
E'where'
148-
FROM
149-
E'update'
150-
`);
151-
});
152-
153-
if (stringTypes.includes("''-qq")) {
154-
it("supports escaping in E'' strings with repeated quote", () => {
155-
expect(format("E'foo '' JOIN bar'")).toBe("E'foo '' JOIN bar'");
156-
});
157-
}
158-
if (stringTypes.includes("''-bs")) {
159-
it("supports escaping in E'' strings with a backslash", () => {
160-
expect(format("E'foo \\' JOIN bar'")).toBe("E'foo \\' JOIN bar'");
161-
});
162-
}
163-
164-
it("detects consecutive E'' strings as separate ones", () => {
165-
expect(format("E'foo'E'bar'")).toBe("E'foo' E'bar'");
166-
});
167-
}
168-
169142
if (stringTypes.includes("X''")) {
170143
it('supports hex byte sequences', () => {
171144
expect(format("x'0E'")).toBe("x'0E'");

test/postgresql.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe('PostgreSqlFormatter', () => {
5252
supportsOnConflict(format);
5353
supportsUpdate(format, { whereCurrentOf: true });
5454
supportsTruncateTable(format, { withoutTable: true });
55-
supportsStrings(format, ["''-qq", "U&''", "X''", "B''", "E''"]);
55+
supportsStrings(format, ["''-qq", "U&''", "X''", "B''"]);
5656
supportsIdentifiers(format, [`""-qq`, 'U&""']);
5757
supportsBetween(format);
5858
supportsSchema(format);
@@ -167,6 +167,7 @@ describe('PostgreSqlFormatter', () => {
167167
FROM
168168
foo
169169
`);
170+
expect(format("E'blah''blah'")).toBe("E'blah''blah'");
170171
});
171172

172173
it('supports dollar-quoted strings', () => {

0 commit comments

Comments
 (0)