diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2018-09-20 15:13:16 -0300 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2018-09-20 15:13:24 -0300 |
| commit | 37e7e969a3fd71bb28910f2351f444d0e2f07655 (patch) | |
| tree | 7e77fb4c290c78e5389267dabf30cc2bb7f9bc55 | |
| parent | 7cf54d66a7c6b6bf355d556e6ecda124ff5760d6 (diff) | |
| download | mullvadvpn-37e7e969a3fd71bb28910f2351f444d0e2f07655.tar.xz mullvadvpn-37e7e969a3fd71bb28910f2351f444d0e2f07655.zip | |
Simplify redaction tests
| -rw-r--r-- | mullvad-problem-report/src/main.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mullvad-problem-report/src/main.rs b/mullvad-problem-report/src/main.rs index 481a13845a..2ae4929082 100644 --- a/mullvad-problem-report/src/main.rs +++ b/mullvad-problem-report/src/main.rs @@ -490,9 +490,7 @@ mod tests { #[test] fn does_not_redact_localhost_ipv4() { - let report = ProblemReport::new(vec![]); - let res = report.redact("127.0.0.1"); - assert_eq!("127.0.0.1", res); + assert_does_not_redact("127.0.0.1"); } #[test] @@ -512,9 +510,7 @@ mod tests { #[test] fn doesnt_redact_not_ipv6() { - let report = ProblemReport::new(vec![]); - let actual = report.redact("[talpid_core::security]"); - assert_eq!("[talpid_core::security]", actual); + assert_does_not_redact("[talpid_core::security]"); } fn assert_redacts_ipv6(input: &str) { @@ -525,8 +521,12 @@ mod tests { #[test] fn test_does_not_redact_time() { + assert_does_not_redact("09:47:59"); + } + + fn assert_does_not_redact(input: &str) { let report = ProblemReport::new(vec![]); - let res = report.redact("09:47:59"); - assert_eq!("09:47:59", res); + let res = report.redact(input); + assert_eq!(input, res); } } |
