Open chris-morgan opened 1 week ago
This test is checking the output of cargo vet diff
, which is actually the git diff
output with a few settings configured:
I'm guessing your local git configuration is configured to either use a different diff backend or in some other way ignore whitespace changes when generating diffs. cargo vet diff
doesn't end up normalizing that, so the diff output appears different and the test fails.
I don't know of a convenient way off the top of my head to fully ignore user customization of git settings in the test, and diabling all user customizations when running the subcommand seems somewhat undesirable.
During the test, set the environment variables GIT_CONFIG_GLOBAL=/dev/null
and GIT_CONFIG_SYSTEM=/dev/null
, and then it succeeds.
Executing the following on my Arch Linux machine, using the v0.10.0 source tarball:
The tests fail in
test-project-diff-output
/format_diff_outputs
.Detailed output
``` ---- test_project_diff_output stdout ---- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Differences ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot file: tests/snapshots/test_cli__test-project-diff-output.snap Snapshot: test-project-diff-output Source: tests/test-cli.rs:284 ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Expression: format_diff_outputs(&output) ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── -old snapshot +new results ────────────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── 72 72 │ + if input.peek(Lit) { 73 73 │ + let lit = input.parse()?; 74 74 │ + return Ok(GenericMethodArgument::Const(Expr::Lit(lit))); 75 75 │ + } 76 │-+ 77 │-+ if input.peek(token::Brace) { 78 │-+ let block: ExprBlock = input.parse()?; 79 │-+ return Ok(GenericMethodArgument::Const(Expr::Block(block))); 80 │-+ } 81 76 │ 82 77 │ - if input.peek(token::Brace) { 83 78 │ - let block: ExprBlock = input.parse()?; 84 79 │ - return Ok(GenericMethodArgument::Const(Expr::Block(block))); 85 │-+ input.parse().map(GenericMethodArgument::Type) 86 │- } 87 │-+ } 80 │+- } 81 │++ if input.peek(token::Brace) { 82 │++ let block: ExprBlock = input.parse()?; 83 │++ return Ok(GenericMethodArgument::Const(Expr::Block(block))); 84 │++ } 88 85 │ 89 86 │ - input.parse().map(GenericMethodArgument::Type) 87 │++ input.parse().map(GenericMethodArgument::Type) 88 │++ } 89 │++ } 90 │++ 90 91 │ + #[cfg(feature = "full")] 91 92 │ + #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] 92 93 │ + impl Parse for MethodTurbofish { 93 94 │ + fn parse(input: ParseStream) -> Result