megamove
This commit is contained in:
parent
c2e201f813
commit
f51105bde0
114 changed files with 92 additions and 0 deletions
9
tests/auto/mycase/main.cpp
Normal file
9
tests/auto/mycase/main.cpp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#include "tst_mycase.h"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
13
tests/auto/mycase/mycase.pro
Normal file
13
tests/auto/mycase/mycase.pro
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
include(../gtest_dependency.pri)
|
||||
|
||||
TEMPLATE = app
|
||||
CONFIG += console c++11
|
||||
CONFIG -= app_bundle
|
||||
CONFIG += thread
|
||||
CONFIG += qt
|
||||
|
||||
QT += core
|
||||
|
||||
HEADERS += tst_mycase.h
|
||||
|
||||
SOURCES += main.cpp ../../../src/SqlLexer.cpp
|
||||
28
tests/auto/mycase/tst_mycase.h
Normal file
28
tests/auto/mycase/tst_mycase.h
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#include <gtest/gtest.h>
|
||||
#include <gmock/gmock-matchers.h>
|
||||
#include "../../../src/SqlLexer.h"
|
||||
|
||||
using namespace testing;
|
||||
|
||||
TEST(mycase, myset)
|
||||
{
|
||||
EXPECT_EQ(1, 1);
|
||||
ASSERT_THAT(0, Eq(0));
|
||||
}
|
||||
|
||||
TEST(mycase, lexer)
|
||||
{
|
||||
QString input = " SELECT ";
|
||||
SqlLexer lexer(input, LexerState::Null);
|
||||
|
||||
int startpos, length;
|
||||
BasicTokenType tokentype;
|
||||
QString out;
|
||||
lexer.nextBasicToken(startpos, length, tokentype, out);
|
||||
|
||||
ASSERT_THAT(startpos, Eq(1));
|
||||
ASSERT_THAT(length, Eq(6));
|
||||
ASSERT_THAT(tokentype, Eq(BasicTokenType::Symbol));
|
||||
ASSERT_THAT( out, Eq(QString("SELECT")) );
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue