good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
U
upper
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
open
upper
Commits
fed0aa1f
Commit
fed0aa1f
authored
8 years ago
by
Paul Xue
Committed by
José Carlos Nieto
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
keep host only connection test case
parent
be9b79f1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
postgresql/connection_test.go
+27
-1
27 additions, 1 deletion
postgresql/connection_test.go
with
27 additions
and
1 deletion
postgresql/connection_test.go
+
27
−
1
View file @
fed0aa1f
...
@@ -88,8 +88,34 @@ func TestParseConnectionURL(t *testing.T) {
...
@@ -88,8 +88,34 @@ func TestParseConnectionURL(t *testing.T) {
var
s
string
var
s
string
var
err
error
var
err
error
s
=
"postgres://anakin:skywalker@localhost:1234/jedis"
s
=
"postgres://anakin:skywalker@localhost/jedis"
if
u
,
err
=
ParseURL
(
s
);
err
!=
nil
{
t
.
Fatal
(
err
)
}
if
u
.
User
!=
"anakin"
{
t
.
Fatal
(
"Failed to parse username."
)
}
if
u
.
Password
!=
"skywalker"
{
t
.
Fatal
(
"Failed to parse password."
)
}
if
u
.
Host
!=
"localhost"
{
t
.
Fatal
(
"Failed to parse hostname."
)
}
if
u
.
Database
!=
"jedis"
{
t
.
Fatal
(
"Failed to parse database."
)
}
if
u
.
Options
[
"sslmode"
]
!=
""
{
t
.
Fatal
(
"Failed to parse SSLMode."
)
}
// case with port
s
=
"postgres://anakin:skywalker@localhost:1234/jedis"
if
u
,
err
=
ParseURL
(
s
);
err
!=
nil
{
if
u
,
err
=
ParseURL
(
s
);
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment