assert-rs / snapbox

Snapshot testing for a herd of CLI tests
docs.rs/trycmd
Apache License 2.0
138 stars 18 forks source link

fix(inline): Fail update on conflict #347

Closed epage closed 4 months ago

epage commented 4 months ago

Fixes #345

epage commented 4 months ago

I want to try this out on Cargo before merging

coveralls commented 4 months ago

Pull Request Test Coverage Report for Build 9867375936

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/snapbox/src/data/runtime.rs 14 15 93.33%
crates/snapbox/src/assert/mod.rs 0 4 0.0%
<!-- Total: 14 19 73.68% -->
Totals Coverage Status
Change from base Build 9860440727: 0.1%
Covered Lines: 1399
Relevant Lines: 2701

💛 - Coveralls
epage commented 4 months ago

Verified on cargo

before

--- i/tests/testsuite/alt_registry.rs
+++ w/tests/testsuite/alt_registry.rs
@@ -1727,10 +1727,18 @@ fn both_index_and_registry() {
             .with_stderr_data(str![[r#"
 [ERROR] the argument '--registry <REGISTRY>' cannot be used with '--index <INDEX>'

-Usage: foo
+Usage: cargo yank --version <VERSION> --registry <REGISTRY> [CRATE]

 For more information, try '--help'.

+"#]
+
+For more information, try '--help'.
+
+"#]r more information, try '--help'.
+
+"#] information, try '--help'.
+
 "#]])
             .run();
     }

after

-- i/tests/testsuite/alt_registry.rs
+++ w/tests/testsuite/alt_registry.rs
@@ -1727,7 +1727,7 @@ fn both_index_and_registry() {
             .with_stderr_data(str![[r#"
 [ERROR] the argument '--registry <REGISTRY>' cannot be used with '--index <INDEX>'

-Usage: foo
+Usage: cargo publish --registry <REGISTRY>

 For more information, try '--help'.
running 1 test
Fixing:
---- expected: tests/testsuite/alt_registry.rs:1727:31
++++ actual:   stderr
   1    1 | [ERROR] the argument '--registry <REGISTRY>' cannot be used with '--index <INDEX>'
   2    2 |
   3      - Usage: foo
        3 + Usage: cargo publish --registry <REGISTRY>
   4    4 |
   5    5 | For more information, try '--help'.

test alt_registry::both_index_and_registry ... FAILED

failures:

---- alt_registry::both_index_and_registry stdout ----
running `/home/epage/src/personal/cargo/target/debug/cargo publish --registry=foo --index=foo`
running `/home/epage/src/personal/cargo/target/debug/cargo owner --registry=foo --index=foo`
thread 'alt_registry::both_index_and_registry' panicked at tests/testsuite/alt_registry.rs:1735:14:

---- expected: tests/testsuite/alt_registry.rs:1727:31
++++ actual:   stderr
   1    1 | [ERROR] the argument '--registry <REGISTRY>' cannot be used with '--index <INDEX>'
   2    2 |
   3      - Usage: foo
        3 + Usage: cargo owner --registry <REGISTRY> [CRATE]
   4    4 |
   5    5 | For more information, try '--help'.

Update failed: cannot update as it was already modified