mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
extra tests for escaping
This commit is contained in:
parent
52e0f838a9
commit
5b4826fd08
@ -22,6 +22,29 @@ describe("Lexer fulltext", () => {
|
||||
.toEqual(["i can use \" or ` or #~=*", "without", "problem"]);
|
||||
});
|
||||
|
||||
it("I can use backslash to escape quotes", () => {
|
||||
expect(lex("hello \\\"world\\\"").fulltextTokens.map(t => t.token))
|
||||
.toEqual(["hello", '"world"']);
|
||||
|
||||
expect(lex("hello \\\'world\\\'").fulltextTokens.map(t => t.token))
|
||||
.toEqual(["hello", "'world'"]);
|
||||
|
||||
expect(lex("hello \\\`world\\\`").fulltextTokens.map(t => t.token))
|
||||
.toEqual(["hello", '`world`']);
|
||||
|
||||
expect(lex('"hello \\\"world\\\"').fulltextTokens.map(t => t.token))
|
||||
.toEqual(['hello "world"']);
|
||||
|
||||
expect(lex("'hello \\\'world\\\''").fulltextTokens.map(t => t.token))
|
||||
.toEqual(["hello 'world'"]);
|
||||
|
||||
expect(lex("`hello \\\`world\\\``").fulltextTokens.map(t => t.token))
|
||||
.toEqual(["hello `world`"]);
|
||||
|
||||
expect(lex("\\#token").fulltextTokens.map(t => t.token))
|
||||
.toEqual(["#token"]);
|
||||
});
|
||||
|
||||
it("quote inside a word does not have a special meaning", () => {
|
||||
const lexResult = lex("d'Artagnan is dead #hero = d'Artagnan");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user