import { highlightSyntax } from '../../syntaxHighlighting/syntaxHighlighting.js';
describe('Unfinished tokens', () => {
    test('Correctly colours unfinished string with double quotes', () => {
        const query = `RETURN "something`;
        expect(highlightSyntax(query)).toEqual([
            {
                bracketInfo: undefined,
                length: 6,
                position: {
                    line: 0,
                    startCharacter: 0,
                    startOffset: 0,
                },
                token: 'RETURN',
                tokenType: 'keyword',
            },
            {
                bracketInfo: undefined,
                length: 10,
                position: {
                    line: 0,
                    startCharacter: 7,
                    startOffset: 7,
                },
                token: '"something',
                tokenType: 'stringLiteral',
            },
        ]);
    });
    test('Correctly colours unfinished string with single quotes', () => {
        const query = `RETURN 'something`;
        expect(highlightSyntax(query)).toEqual([
            {
                bracketInfo: undefined,
                length: 6,
                position: {
                    line: 0,
                    startCharacter: 0,
                    startOffset: 0,
                },
                token: 'RETURN',
                tokenType: 'keyword',
            },
            {
                bracketInfo: undefined,
                length: 10,
                position: {
                    line: 0,
                    startCharacter: 7,
                    startOffset: 7,
                },
                token: "'something",
                tokenType: 'stringLiteral',
            },
        ]);
    });
    test('Correctly colours unfinished multiline strings', () => {
        const query = `RETURN "something
        foo
        bar`;
        expect(highlightSyntax(query)).toEqual([
            {
                bracketInfo: undefined,
                length: 6,
                position: {
                    line: 0,
                    startCharacter: 0,
                    startOffset: 0,
                },
                token: 'RETURN',
                tokenType: 'keyword',
            },
            {
                bracketInfo: undefined,
                length: 10,
                position: {
                    line: 0,
                    startCharacter: 7,
                    startOffset: 7,
                },
                token: '"something',
                tokenType: 'stringLiteral',
            },
            {
                bracketInfo: undefined,
                length: 11,
                position: {
                    line: 1,
                    startCharacter: 0,
                    startOffset: 18,
                },
                token: '        foo',
                tokenType: 'stringLiteral',
            },
            {
                bracketInfo: undefined,
                length: 11,
                position: {
                    line: 2,
                    startCharacter: 0,
                    startOffset: 30,
                },
                token: '        bar',
                tokenType: 'stringLiteral',
            },
        ]);
    });
    test('Correctly colours unfinished multiline comment', () => {
        const query = `/* something
        foo
        MATCH (n)`;
        expect(highlightSyntax(query)).toEqual([
            {
                bracketInfo: undefined,
                length: 12,
                position: {
                    line: 0,
                    startCharacter: 0,
                    startOffset: 0,
                },
                token: '/* something',
                tokenType: 'comment',
            },
            {
                bracketInfo: undefined,
                length: 11,
                position: {
                    line: 1,
                    startCharacter: 0,
                    startOffset: 13,
                },
                token: '        foo',
                tokenType: 'comment',
            },
            {
                bracketInfo: undefined,
                length: 17,
                position: {
                    line: 2,
                    startCharacter: 0,
                    startOffset: 25,
                },
                token: '        MATCH (n)',
                tokenType: 'comment',
            },
        ]);
    });
    test('Correctly colours unfinished property keys', () => {
        const query = `RETURN {\`something
    foo
    
    bar: "hello"}`;
        expect(highlightSyntax(query)).toEqual([
            {
                bracketInfo: undefined,
                length: 6,
                position: {
                    line: 0,
                    startCharacter: 0,
                    startOffset: 0,
                },
                token: 'RETURN',
                tokenType: 'keyword',
            },
            {
                bracketInfo: {
                    bracketLevel: 0,
                    bracketType: 'curly',
                },
                length: 1,
                position: {
                    line: 0,
                    startCharacter: 7,
                    startOffset: 7,
                },
                token: '{',
                tokenType: 'bracket',
            },
            {
                bracketInfo: undefined,
                length: 10,
                position: {
                    line: 0,
                    startCharacter: 8,
                    startOffset: 8,
                },
                token: '`something',
                tokenType: 'symbolicName',
            },
            {
                bracketInfo: undefined,
                length: 7,
                position: {
                    line: 1,
                    startCharacter: 0,
                    startOffset: 19,
                },
                token: '    foo',
                tokenType: 'symbolicName',
            },
            {
                bracketInfo: undefined,
                length: 4,
                position: {
                    line: 2,
                    startCharacter: 0,
                    startOffset: 27,
                },
                token: '    ',
                tokenType: 'symbolicName',
            },
            {
                bracketInfo: undefined,
                length: 17,
                position: {
                    line: 3,
                    startCharacter: 0,
                    startOffset: 32,
                },
                token: '    bar: "hello"}',
                tokenType: 'symbolicName',
            },
        ]);
    });
    test('Correctly colours multiline comments', () => {
        const query = `/* something
    foo
    
    bar */`;
        expect(highlightSyntax(query)).toEqual([
            {
                bracketInfo: undefined,
                length: 12,
                position: {
                    line: 0,
                    startCharacter: 0,
                    startOffset: 0,
                },
                token: '/* something',
                tokenType: 'comment',
            },
            {
                bracketInfo: undefined,
                length: 7,
                position: {
                    line: 1,
                    startCharacter: 0,
                    startOffset: 13,
                },
                token: '    foo',
                tokenType: 'comment',
            },
            {
                bracketInfo: undefined,
                length: 4,
                position: {
                    line: 2,
                    startCharacter: 0,
                    startOffset: 21,
                },
                token: '    ',
                tokenType: 'comment',
            },
            {
                bracketInfo: undefined,
                length: 10,
                position: {
                    line: 3,
                    startCharacter: 0,
                    startOffset: 26,
                },
                token: '    bar */',
                tokenType: 'comment',
            },
        ]);
    });
    test('Correctly colours single line comments', () => {
        const query = `// single line comment`;
        expect(highlightSyntax(query)).toEqual([
            {
                bracketInfo: undefined,
                length: 22,
                position: {
                    line: 0,
                    startCharacter: 0,
                    startOffset: 0,
                },
                token: '// single line comment',
                tokenType: 'comment',
            },
        ]);
    });
});
//# sourceMappingURL=misc.test.js.map