diff --git a/src/file.rs b/src/file.rs index da54aab..d158d24 100644 --- a/src/file.rs +++ b/src/file.rs @@ -1325,55 +1325,61 @@ mod display { #[test] fn can_reconstruct_non_empty_config() { - let config = r#"[user] - email = code@eddie.sh -[core] - autocrlf = input -[push] - default = simple -[commit] - gpgsign = true -[gpg] - program = gpg -[url "ssh://git@github.com/"] - insteadOf = "github://" -[url "ssh://git@git.eddie.sh/edward/"] - insteadOf = "gitea://" -[pull] - ff = only -[init] - defaultBranch = master"#; + let config = r#" + [user] + email = code@eddie.sh + [core] + autocrlf = input + [push] + default = simple + [commit] + gpgsign = true + [gpg] + program = gpg + [url "ssh://git@github.com/"] + insteadOf = "github://" + [url "ssh://git@git.eddie.sh/edward/"] + insteadOf = "gitea://" + [pull] + ff = only + [init] + defaultBranch = master + "#; assert_eq!(GitConfig::try_from(config).unwrap().to_string(), config); } #[test] fn can_reconstruct_configs_with_implicits() { - let config = r#"[user] - email - name -[core] - autocrlf -[push] - default -[commit] - gpgsign"#; + let config = r#" + [user] + email + name + [core] + autocrlf + [push] + default + [commit] + gpgsign + "#; assert_eq!(GitConfig::try_from(config).unwrap().to_string(), config); } #[test] fn can_reconstruct_configs_without_whitespace_in_middle() { - let config = r#"[core] - autocrlf=input -[push] - default=simple -[commit] - gpgsign=true -[pull] - ff = only -[init] - defaultBranch = master"#; + let config = r#" + [core] + autocrlf=input + [push] + default=simple + [commit] + gpgsign=true + [pull] + ff = only + [init] + defaultBranch = master + "#; assert_eq!(GitConfig::try_from(config).unwrap().to_string(), config); }