style: fmt & clippy processed

This commit is contained in:
VC
2022-08-11 12:29:40 +02:00
parent dab8725f99
commit b11595bfca
10 changed files with 297 additions and 209 deletions

View File

@@ -4,7 +4,10 @@ use scootaloo::parse_toml;
fn test_parse_good_toml() {
let parse_good_toml = parse_toml("tests/good_test.toml");
assert_eq!(parse_good_toml.scootaloo.db_path, "/var/random/scootaloo.sqlite");
assert_eq!(
parse_good_toml.scootaloo.db_path,
"/var/random/scootaloo.sqlite"
);
assert_eq!(parse_good_toml.scootaloo.cache_path, "/tmp/scootaloo");
assert_eq!(parse_good_toml.twitter.username, "tamerelol");
@@ -16,18 +19,25 @@ fn test_parse_good_toml() {
assert_eq!(parse_good_toml.mastodon.base, "https://m.nintendojo.fr");
assert_eq!(parse_good_toml.mastodon.client_id, "rand client id");
assert_eq!(parse_good_toml.mastodon.client_secret, "secret");
assert_eq!(parse_good_toml.mastodon.redirect, "urn:ietf:wg:oauth:2.0:oob");
assert_eq!(
parse_good_toml.mastodon.redirect,
"urn:ietf:wg:oauth:2.0:oob"
);
assert_eq!(parse_good_toml.mastodon.token, "super secret");
}
#[test]
#[should_panic(expected = "Cannot open config file tests/no_file.toml: No such file or directory (os error 2)")]
#[should_panic(
expected = "Cannot open config file tests/no_file.toml: No such file or directory (os error 2)"
)]
fn test_parse_no_toml() {
let _parse_no_toml = parse_toml("tests/no_file.toml");
}
#[test]
#[should_panic(expected = "Cannot parse TOML file tests/bad_test.toml: expected an equals, found a newline at line 1 column 5")]
#[should_panic(
expected = "Cannot parse TOML file tests/bad_test.toml: expected an equals, found a newline at line 1 column 5"
)]
fn test_parse_bad_toml() {
let _parse_bad_toml = parse_toml("tests/bad_test.toml");
}