+5
.changeset/two-days-nail.md
+5
.changeset/two-days-nail.md
+17
src/__tests__/parser.test.ts
+17
src/__tests__/parser.test.ts
···
73
73
}).toThrow();
74
74
});
75
75
76
+
it('parses escaped characters', () => {
77
+
let ast = parse(`
78
+
{ field(arg: "Has another \\\\x sequence.") }
79
+
`);
80
+
expect(ast).toHaveProperty(
81
+
'definitions.0.selectionSet.selections.0.arguments.0.value.value',
82
+
'Has another \\x sequence.'
83
+
);
84
+
ast = parse(`
85
+
{ field(arg: "Has a \\\\x sequence.") }
86
+
`);
87
+
expect(ast).toHaveProperty(
88
+
'definitions.0.selectionSet.selections.0.arguments.0.value.value',
89
+
'Has a \\x sequence.'
90
+
);
91
+
});
92
+
76
93
it('parses multi-byte characters', () => {
77
94
// Note: \u0A0A could be naively interpreted as two line-feed chars.
78
95
const ast = parse(`