summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Renner Berthing <esmil@mailme.dk>2013-01-30 00:16:27 +0100
committerEmil Renner Berthing <esmil@mailme.dk>2013-01-31 15:57:32 +0100
commit69ccd279951c1b2816e6b650d2275fb39ff15b10 (patch)
tree5db58c483158113fde1d646b8470e649dc9df85f
parent43334b08b318449f42ae25f0ac8878070f7d9402 (diff)
downloadlem-postgres-69ccd279951c1b2816e6b650d2275fb39ff15b10.tar.gz
lem-postgres-69ccd279951c1b2816e6b650d2275fb39ff15b10.tar.xz
lem-postgres-69ccd279951c1b2816e6b650d2275fb39ff15b10.zip
test: connect with password and fix newsleeper
-rwxr-xr-xqtest.lua9
-rwxr-xr-xtest.lua9
2 files changed, 14 insertions, 4 deletions
diff --git a/qtest.lua b/qtest.lua
index bc3dfe2..6bf446e 100755
--- a/qtest.lua
+++ b/qtest.lua
@@ -56,7 +56,12 @@ end
local utils = require 'lem.utils'
local postgres = require 'lem.postgres.queued'
-local db = assert(postgres.connect("host=localhost dbname=mydb"))
+local db = assert(postgres.connect([[
+host=localhost
+user=myuser
+password=mypasswd
+dbname=mydb
+]]))
assert(db:exec(
'CREATE TABLE mytable (id integer PRIMARY KEY, name CHARACTER VARYING)'))
@@ -106,7 +111,7 @@ do
end
utils.spawn(function()
- utils.sleeper():sleep(1.0)
+ utils.newsleeper():sleep(1.0)
assert(db:exec('DROP TABLE mytable'))
end)
diff --git a/test.lua b/test.lua
index 36cb690..5eff37a 100755
--- a/test.lua
+++ b/test.lua
@@ -56,10 +56,15 @@ end
local utils = require 'lem.utils'
local postgres = require 'lem.postgres'
-local db = assert(postgres.connect("host=localhost dbname=mydb"))
+local db = assert(postgres.connect([[
+host=localhost
+user=myuser
+password=mypasswd
+dbname=mydb
+]]))
assert(db:exec(
-'CREATE TABLE mytable (id integer PRIMARY KEY, name CHARACTER VARYING)'))
+'CREATE TABLE mytable (id integer PRIMARY KEY, name TEXT)'))
assert(db:exec("COPY mytable FROM STDIN (delimiter ',')"))
assert(db:put('1,alpha\n'))