summaryrefslogtreecommitdiffstats
path: root/yql/essentials/sql/v1/lexer/check/check_lexers_ut.cpp
blob: a0d9ea2a95370f06a1b28c4c90e9d9a4d9960ec6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <library/cpp/testing/unittest/registar.h>

#include <yql/essentials/sql/v1/lexer/check/check_lexers.h>

Y_UNIT_TEST_SUITE(CheckLexers) {

Y_UNIT_TEST(PgSyntax) {
    TString query = R"sql(
        --!syntax_pg
        SELECT
            convert_from(a, 'UTF8')
        FROM
            plato.x
        WHERE
            convert_from(b, 'UTF8') !~ '^[0-9]+$';
    )sql";

    NYql::TIssues issues;
    bool result = NSQLTranslationV1::CheckLexers(NYql::TPosition(), query, issues);

    UNIT_ASSERT_C(result, issues.ToString());
}

} // Y_UNIT_TEST_SUITE(CheckLexers)