aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/sql/v1/complete/text/word_ut.cpp
blob: 0eff931b1af80236e2ee2eca000bd8feffcec032 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "word.h"

#include <library/cpp/testing/unittest/registar.h>

using namespace NSQLComplete;

Y_UNIT_TEST_SUITE(WordTest) {
    Y_UNIT_TEST(Blank) {
        UNIT_ASSERT_VALUES_EQUAL(LastWord(""), "");
        UNIT_ASSERT_VALUES_EQUAL(LastWord(" "), "");
        UNIT_ASSERT_VALUES_EQUAL(LastWord("  "), "");
        UNIT_ASSERT_VALUES_EQUAL(LastWord("   "), "");
    }

    Y_UNIT_TEST(Space) {
        UNIT_ASSERT_VALUES_EQUAL(LastWord("two "), "");
        UNIT_ASSERT_VALUES_EQUAL(LastWord("one two "), "");
        UNIT_ASSERT_VALUES_EQUAL(LastWord("two"), "two");
        UNIT_ASSERT_VALUES_EQUAL(LastWord("one two"), "two");
    }
} // Y_UNIT_TEST_SUITE(WordTest)