Skip to content

Commit fcd37f5

Browse files
committed
fix: fix failed test case
1 parent 9f07f66 commit fcd37f5

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

mdsn/src/lib.rs

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,6 @@ mod tests {
10511051
#[test]
10521052
fn username_with_password() {
10531053
let s = "taos://";
1054-
10551054
let dsn = Dsn::from_str(s).unwrap();
10561055
assert_eq!(
10571056
dsn,
@@ -1063,7 +1062,6 @@ mod tests {
10631062
assert_eq!(dsn.to_string(), s);
10641063

10651064
let s = "taos:///";
1066-
10671065
let dsn = Dsn::from_str(s).unwrap();
10681066
assert_eq!(
10691067
dsn,
@@ -1075,7 +1073,6 @@ mod tests {
10751073
assert_eq!(dsn.to_string(), "taos://");
10761074

10771075
let s = "taos://root@";
1078-
10791076
let dsn = Dsn::from_str(s).unwrap();
10801077
assert_eq!(
10811078
dsn,
@@ -1086,8 +1083,8 @@ mod tests {
10861083
}
10871084
);
10881085
assert_eq!(dsn.to_string(), s);
1089-
let s = "taos://root:taosdata@";
10901086

1087+
let s = "taos://root:taosdata@";
10911088
let dsn = Dsn::from_str(s).unwrap();
10921089
assert_eq!(
10931090
dsn,
@@ -1098,7 +1095,7 @@ mod tests {
10981095
..Default::default()
10991096
}
11001097
);
1101-
assert_eq!(dsn.to_string(), s);
1098+
assert_eq!(dsn.to_string(), "taos://root:[REDACTED]@");
11021099
}
11031100

11041101
#[test]
@@ -1174,6 +1171,7 @@ mod tests {
11741171
}
11751172
);
11761173
}
1174+
11771175
#[test]
11781176
fn username_with_host() {
11791177
let s = "taos://root@localhost";
@@ -1232,7 +1230,7 @@ mod tests {
12321230
..Default::default()
12331231
}
12341232
);
1235-
assert_eq!(dsn.to_string(), s);
1233+
assert_eq!(dsn.to_string(), "taos://root:[REDACTED]@localhost:6030");
12361234
}
12371235

12381236
#[test]
@@ -1278,7 +1276,10 @@ mod tests {
12781276
..Default::default()
12791277
}
12801278
);
1281-
assert_eq!(dsn.to_string(), s);
1279+
assert_eq!(
1280+
dsn.to_string(),
1281+
"taos://root:[REDACTED]@host1:6030,host2:6031"
1282+
);
12821283
}
12831284

12841285
#[test]
@@ -1337,7 +1338,10 @@ mod tests {
13371338
..Default::default()
13381339
}
13391340
);
1340-
assert_eq!(dsn.to_string(), s);
1341+
assert_eq!(
1342+
dsn.to_string(),
1343+
"taos://root:[REDACTED]@host1:6030,host2:6031/db1"
1344+
);
13411345
}
13421346

13431347
#[test]
@@ -1443,7 +1447,10 @@ mod tests {
14431447
..Default::default()
14441448
}
14451449
);
1446-
assert_eq!(dsn.to_string(), s);
1450+
assert_eq!(
1451+
dsn.to_string(),
1452+
"sqlite://root:[REDACTED]@//full/unix/path/to/file.db?mode=0666&readonly=true"
1453+
);
14471454
}
14481455

14491456
#[test]
@@ -1552,7 +1559,10 @@ mod tests {
15521559
let dsn = Dsn::from_str(&format!("taos://root:{e}@localhost:6030/")).unwrap();
15531560
dbg!(&dsn);
15541561
assert_eq!(dsn.password.as_deref().unwrap(), p);
1555-
assert_eq!(dsn.to_string(), format!("taos://root:{e}@localhost:6030"));
1562+
assert_eq!(
1563+
dsn.to_string(),
1564+
format!("taos://root:[REDACTED]@localhost:6030")
1565+
);
15561566
}
15571567

15581568
#[test]
@@ -1567,7 +1577,7 @@ mod tests {
15671577
assert_eq!(dsn.get("code1").unwrap(), p);
15681578
assert_eq!(
15691579
dsn.to_string(),
1570-
format!("taos://root:{e}@localhost:6030?code1={e}")
1580+
format!("taos://root:[REDACTED]@localhost:6030?code1={e}")
15711581
);
15721582
}
15731583

@@ -1586,7 +1596,7 @@ mod tests {
15861596
assert_eq!(dsn.get(p).unwrap(), p);
15871597
assert_eq!(
15881598
dsn.to_string(),
1589-
format!("taos://{u}:{e}@localhost:6030?{e}={e}")
1599+
format!("taos://{u}:[REDACTED]@localhost:6030?{e}={e}")
15901600
);
15911601
}
15921602

0 commit comments

Comments
 (0)