mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-06 05:42:38 +00:00
fix test
This commit is contained in:
parent
ac4a9c3c1d
commit
4c28cd5c50
@ -556,21 +556,21 @@ fn test_load_password_from_line() {
|
||||
assert_eq!(
|
||||
load_password_from_line(
|
||||
"localhost:5432:foo:bar:baz",
|
||||
Some("localhost"),
|
||||
"localhost",
|
||||
5432,
|
||||
"foo",
|
||||
"bar"
|
||||
Some("bar")
|
||||
),
|
||||
Some("baz".to_owned())
|
||||
);
|
||||
// wildcard
|
||||
assert_eq!(
|
||||
load_password_from_line("*:5432:foo:bar:baz", Some("localhost"), 5432, "foo", "bar"),
|
||||
load_password_from_line("*:5432:foo:bar:baz", "localhost", 5432, "foo", Some("bar")),
|
||||
Some("baz".to_owned())
|
||||
);
|
||||
// default to localhost
|
||||
// accept wildcard with missing db
|
||||
assert_eq!(
|
||||
load_password_from_line("localhost:5432:foo:bar:baz", None, 5432, "foo", "bar"),
|
||||
load_password_from_line("localhost:5432:foo:*:baz", "localhost", 5432, "foo", None),
|
||||
Some("baz".to_owned())
|
||||
);
|
||||
|
||||
@ -578,16 +578,22 @@ fn test_load_password_from_line() {
|
||||
assert_eq!(
|
||||
load_password_from_line(
|
||||
"thishost:5432:foo:bar:baz",
|
||||
Some("thathost"),
|
||||
"thathost",
|
||||
5432,
|
||||
"foo",
|
||||
"bar"
|
||||
Some("bar")
|
||||
),
|
||||
None
|
||||
);
|
||||
// malformed entry
|
||||
assert_eq!(
|
||||
load_password_from_line("localhost:5432:foo:bar", None, 5432, "foo", "bar"),
|
||||
load_password_from_line(
|
||||
"localhost:5432:foo:bar",
|
||||
"localhost",
|
||||
5432,
|
||||
"foo",
|
||||
Some("bar")
|
||||
),
|
||||
None
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user