better test formatting
This commit is contained in:
parent
60fe0deb91
commit
559afb01fa
1 changed files with 43 additions and 37 deletions
80
src/file.rs
80
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);
|
||||
}
|
||||
|
|
Reference in a new issue