mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
.autotest
git-svn-id: svn://ultimatepp.org/upp/trunk@7250 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
3c21208ecf
commit
17b84ec741
4 changed files with 57 additions and 1 deletions
|
|
@ -94,6 +94,8 @@ void Test(int dialect, const char *dialectn, SqlStatement s, const char *q)
|
|||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
StdLogSetup(LOG_COUT|LOG_FILE);
|
||||
|
||||
SqlId::UseQuotes();
|
||||
|
||||
Date date = Date(2011, 12, 31);
|
||||
|
|
@ -227,5 +229,5 @@ CONSOLE_APP_MAIN
|
|||
LOG("\n\n\n=========================================================================");
|
||||
#include "Test.i"
|
||||
|
||||
LOG("OK");
|
||||
LOG("================== OK");
|
||||
}
|
||||
|
|
|
|||
39
autotest/SqlId/SqlId.cpp
Normal file
39
autotest/SqlId/SqlId.cpp
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#include <Sql/Sql.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
SQLID(COLUMN)
|
||||
SQLID(TABLE)
|
||||
|
||||
SQLID(column)
|
||||
SQLID(table)
|
||||
|
||||
void Test(SqlStatement s, const char *e)
|
||||
{
|
||||
String h = s.Get(PGSQL);
|
||||
|
||||
LOG(h);
|
||||
LOG(" " << AsCString(h));
|
||||
|
||||
ASSERT(h == e);
|
||||
}
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
StdLogSetup(LOG_COUT|LOG_FILE);
|
||||
|
||||
Test(Select(COLUMN).From(TABLE), "select COLUMN from TABLE");
|
||||
SqlId::UseQuotes();
|
||||
Test(Select(COLUMN).From(TABLE), "select \"COLUMN\" from \"TABLE\"");
|
||||
SqlId::ToUpperCase();
|
||||
Test(Select(column).From(table), "select \"COLUMN\" from \"TABLE\"");
|
||||
SqlId::ToLowerCase();
|
||||
Test(Select(COLUMN).From(TABLE), "select \"column\" from \"table\"");
|
||||
SqlId::UseQuotes(false);
|
||||
SqlId::ToUpperCase();
|
||||
Test(Select(column).From(table), "select COLUMN from TABLE");
|
||||
SqlId::ToLowerCase();
|
||||
Test(Select(COLUMN).From(TABLE), "select column from table");
|
||||
|
||||
LOG("================ OK");
|
||||
}
|
||||
10
autotest/SqlId/SqlId.upp
Normal file
10
autotest/SqlId/SqlId.upp
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
uses
|
||||
Core,
|
||||
Sql;
|
||||
|
||||
file
|
||||
SqlId.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "SSE2";
|
||||
|
||||
5
autotest/SqlId/init
Normal file
5
autotest/SqlId/init
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#ifndef _SqlId_icpp_init_stub
|
||||
#define _SqlId_icpp_init_stub
|
||||
#include "Core/init"
|
||||
#include "Sql/init"
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue