Add fallback for constraint parsing

This commit is contained in:
Alexey Romanov
2015-03-02 10:27:22 +03:00
parent a4f1d990a0
commit 32149a35ad
2 changed files with 21 additions and 4 deletions

View File

@@ -40,6 +40,7 @@ all_test_() ->
fun open_db/0,
fun close_db/1,
[?FuncTest(basic_functionality),
?FuncTest(table_info),
?FuncTest(parametrized),
?FuncTest(negative),
?FuncTest(blob),
@@ -131,6 +132,19 @@ basic_functionality() ->
ok,
sqlite3:drop_table(ct, user)).
table_info() ->
Sql = <<"CREATE TABLE table_info_test (
id INTEGER PRIMARY KEY,
ts TEXT default (timestamp('now')),
key TEXT);">>,
ExpectedTableInfo =
sqlite3:sql_exec(ct,Sql),
?assertMatch(
[{id, integer, [primary_key]},
{ts, text, [{cant_parse_constraints, _}]},
{key, text}],
sqlite3:table_info(ct,table_info_test)).
parametrized() ->
drop_table_if_exists(ct, user1),
sqlite3:create_table(ct, user1, [{id, integer}, {name, text}]),