first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,326 @@
|
||||
# Resolvable
|
||||
|
||||
{{ 1 + 1 }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Empty Resolvable
|
||||
|
||||
{{}}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable of only whitespace
|
||||
|
||||
{{ }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# No content
|
||||
|
||||
|
||||
|
||||
==>
|
||||
|
||||
Program
|
||||
|
||||
# Plaintext
|
||||
|
||||
text
|
||||
|
||||
==>
|
||||
|
||||
Program(Plaintext)
|
||||
|
||||
# Plaintext of single-brace-wrapped text
|
||||
|
||||
{text}
|
||||
|
||||
==>
|
||||
|
||||
Program(Plaintext)
|
||||
|
||||
# Plaintext then Resolvable
|
||||
|
||||
text {{ 1 + 1 }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Plaintext, Resolvable)
|
||||
|
||||
# Resolvable then Plaintext
|
||||
|
||||
{{ 1 + 1 }} Plaintext
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable, Plaintext)
|
||||
|
||||
# Plaintext then Resolvable then Plaintext
|
||||
|
||||
text {{ 1 + 1 }} text
|
||||
|
||||
==>
|
||||
|
||||
Program(Plaintext, Resolvable, Plaintext)
|
||||
|
||||
# Resolvable then Plaintext then Resolvable
|
||||
|
||||
{{ 1 + 1 }} text {{ 1 + 1 }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable,Plaintext,Resolvable)
|
||||
|
||||
# Plaintext then Resolvable then Plaintext then Resolvable
|
||||
|
||||
text {{ 1 + 1 }} text {{ 1 + 1 }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Plaintext, Resolvable, Plaintext, Resolvable)
|
||||
|
||||
# Resolvable then Plaintext then Resolvable then Plaintext
|
||||
|
||||
{{ 1 + 1 }} text {{ 1 + 1 }} text
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable,Plaintext,Resolvable,Plaintext)
|
||||
|
||||
# Resolvable containing all resolvable chars
|
||||
|
||||
{{ he ()[]{<>~`!@#$%^&*-_+=|\;:'",./?\{ llo }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable containing single left brace
|
||||
|
||||
{{ he { llo }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable containing double left brace
|
||||
|
||||
{{ he {{ llo }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable containing triple left brace
|
||||
|
||||
{{ he {{{ llo }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable containing single right brace
|
||||
|
||||
{{ he } llo }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable containing escaped double right brace
|
||||
|
||||
{{ he \}} llo }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable containing escaped triple right brace
|
||||
|
||||
{{ he \}}} llo }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable containing single-brace-wrapped text with escaping
|
||||
|
||||
{{ he { abc } llo }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable containing double-brace-wrapped text with escaping
|
||||
|
||||
{{ he {{ abc \}} llo }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable containing triple-brace-wrapped text with escaping
|
||||
|
||||
{{ he {{{ abc \}}} llo }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable containing single-bracket-wrapped text
|
||||
|
||||
{{ he [ abc ] llo }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable containing double-bracket-wrapped text
|
||||
|
||||
{{ he [[ abc ]] llo }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable containing triple-bracket-wrapped text
|
||||
|
||||
{{ he [[[ abc ]]] llo }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Plaintext of one opening brace
|
||||
|
||||
{
|
||||
|
||||
==>
|
||||
|
||||
Program(Plaintext)
|
||||
|
||||
# Plaintext of one opening brace and two closing braces
|
||||
|
||||
{ }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Plaintext)
|
||||
|
||||
# Plaintext then Resolvable with non-ASCII chars then Plaintext
|
||||
|
||||
a {{ 'áßи' }} a
|
||||
|
||||
==>
|
||||
|
||||
Program(Plaintext, Resolvable, Plaintext)
|
||||
|
||||
# Resolvable with currency symbol
|
||||
|
||||
{{ '€' }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable with cyrillic char
|
||||
|
||||
{{ 'л' }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable with Pictographs char
|
||||
|
||||
{{ '🎉' }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable with Emoticons char
|
||||
|
||||
{{ '😎' }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable with general punctuation char
|
||||
|
||||
{{ '†' }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable with superscript char
|
||||
|
||||
{{ '⁷' }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable with CJK char
|
||||
|
||||
{{ '漢' }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable with new emoji range
|
||||
|
||||
{{ '🟢' }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable with new emoji range end of range
|
||||
|
||||
{{ '🫸' }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable with start of Dingbat range - U+2700
|
||||
|
||||
{{ '✀' }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable with end of Dingbat range - U+27BF
|
||||
|
||||
{{ '➿' }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable with zap emoji - U+26A1
|
||||
|
||||
{{ '⚡' }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
|
||||
# Resolvable with character near end of Unicode range U+10FFFD
|
||||
{{ '' }}
|
||||
|
||||
==>
|
||||
|
||||
Program(Resolvable)
|
||||
@@ -0,0 +1,22 @@
|
||||
import { fileTests as runTestFile } from '@lezer/generator/dist/test';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import { n8nLanguage } from '../../src/expressions/index';
|
||||
|
||||
describe('expressions language', () => {
|
||||
const CASES_DIR = __dirname;
|
||||
for (const testFile of fs.readdirSync(CASES_DIR)) {
|
||||
if (!/\.txt$/.test(testFile)) continue;
|
||||
|
||||
const testFileName = /^[^\.]*/.exec(testFile)![0];
|
||||
describe(testFileName, () => {
|
||||
for (const { name, run } of runTestFile(
|
||||
fs.readFileSync(path.join(CASES_DIR, testFile), 'utf8'),
|
||||
testFile,
|
||||
)) {
|
||||
it(name, () => run(n8nLanguage.parser));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user