More test changes
This commit is contained in:
@@ -122,24 +122,21 @@ escaping() ->
|
|||||||
sqlite3:read_all(ct, escaping)).
|
sqlite3:read_all(ct, escaping)).
|
||||||
|
|
||||||
select_many_records() ->
|
select_many_records() ->
|
||||||
|
N = 1024,
|
||||||
drop_table_if_exists(ct, many_records),
|
drop_table_if_exists(ct, many_records),
|
||||||
sqlite3:create_table(ct, many_records, [{id, integer}, {name, text}]),
|
sqlite3:create_table(ct, many_records, [{id, integer}, {name, text}]),
|
||||||
sqlite3:write_many(ct, many_records, [[{id, X}, {name, "bar"}] || X <- lists:seq(1, 1024)]),
|
sqlite3:write_many(ct, many_records, [[{id, X}, {name, "bar"}] || X <- lists:seq(1, N)]),
|
||||||
Columns = ["id", "name"],
|
Columns = ["id", "name"],
|
||||||
?assertEqual(
|
?assertEqual(
|
||||||
[{columns, Columns}, {rows, [{1, <<"bar">>}]}],
|
[{columns, Columns}, {rows, [{1, <<"bar">>}]}],
|
||||||
sqlite3:read(ct, many_records, {id, 1})),
|
sqlite3:read(ct, many_records, {id, 1})),
|
||||||
|
[?assertEqual(
|
||||||
|
M,
|
||||||
|
length(rows(sqlite3:sql_exec(
|
||||||
|
ct, io_lib:format("select * from many_records limit ~p;", [M])))))
|
||||||
|
|| M <- [10, 100, 1000]],
|
||||||
?assertEqual(
|
?assertEqual(
|
||||||
10,
|
N,
|
||||||
length(rows(sqlite3:sql_exec(ct, "select * from many_records limit 10;")))),
|
|
||||||
?assertEqual(
|
|
||||||
100,
|
|
||||||
length(rows(sqlite3:sql_exec(ct, "select * from many_records limit 100;")))),
|
|
||||||
?assertEqual(
|
|
||||||
1000,
|
|
||||||
length(rows(sqlite3:sql_exec(ct, "select * from many_records limit 1000;")))),
|
|
||||||
?assertEqual(
|
|
||||||
1024,
|
|
||||||
length(rows(sqlite3:sql_exec(ct, "select * from many_records;")))).
|
length(rows(sqlite3:sql_exec(ct, "select * from many_records;")))).
|
||||||
|
|
||||||
%% note that inserts are actually serialized by gen_server
|
%% note that inserts are actually serialized by gen_server
|
||||||
|
|||||||
Reference in New Issue
Block a user