-
Notifications
You must be signed in to change notification settings - Fork 204
/
Copy pathtest_sqlite3.rb
41 lines (34 loc) · 1.21 KB
/
test_sqlite3.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
require "helper"
module SQLite3
class TestSQLite3 < SQLite3::TestCase
def test_libversion
assert_not_nil SQLite3.libversion
end
def test_threadsafe
assert_not_nil SQLite3.threadsafe
end
def test_threadsafe?
if SQLite3.threadsafe > 0
assert_predicate SQLite3, :threadsafe?
else
refute_predicate SQLite3, :threadsafe?
end
end
def test_compiled_version_and_loaded_version
assert_equal(SQLite3::SQLITE_VERSION, SQLite3::SQLITE_LOADED_VERSION)
end
def test_status
status = SQLite3.status(SQLite3::Constants::Status::MEMORY_USED)
assert_operator(status.fetch(:current), :>=, 0)
assert_operator(status.fetch(:highwater), :>=, status.fetch(:current))
end
def test_status_reset_highwater_mark
status = SQLite3.status(SQLite3::Constants::Status::MEMORY_USED, false)
assert_operator(status.fetch(:current), :>=, 0)
assert_operator(status.fetch(:highwater), :>=, status.fetch(:current))
status = SQLite3.status(SQLite3::Constants::Status::MEMORY_USED, true)
assert_operator(status.fetch(:current), :>=, 0)
assert_operator(status.fetch(:highwater), :>=, status.fetch(:current))
end
end
end