-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_pguriparse.lua
More file actions
40 lines (36 loc) · 1.07 KB
/
test_pguriparse.lua
File metadata and controls
40 lines (36 loc) · 1.07 KB
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
#!/usr/bin/env lua
strutil = require('datautil.string')
F = require('datautil.functional')
parse = require('everlooping.pquriparse').parse
uris = [[
postgresql://postgres@localhost:5432/postgres
postgresql://postgres@localhost/postgres
postgresql://localhost:5432/postgres
postgresql://localhost/postgres
postgresql://postgres@localhost:5432/
postgresql://postgres@localhost/
postgresql://localhost:5432/
postgresql://localhost:5432
postgresql://localhost/postgres
postgresql://localhost/
postgresql://localhost
postgresql:///
postgresql://
postgresql://%6Cocalhost/
postgresql://localhost/postgres?user=postgres
postgresql://localhost/postgres?user=postgres&port=5432
postgresql://localhost/postgres?user=postgres&port=5432
postgresql://localhost:5432?user=postgres
postgresql://localhost?user=postgres
postgresql://localhost?uzer=
postgresql://localhost?
postgresql://[::1]:5432/postgres
postgresql://[::1]/postgres
postgresql://[::1]/
postgresql://[::1]
postgres://
postgres://postgres:@localhost/testdb
]]
F.each(strutil.split(uris), function(i)
print('>>', i, '>>>', parse(i))
end)