cargo/tests/testsuite/cargo_add/overwrite_preserves_inline_table
Ed Page b78f91831e test(add): Ensure comments are preserved
A comment on killercup/cargo-edit#15 had me worried that `cargo add` was
deleting comments now.  It appears that isn't the case for inline
tables.

Standard tables however do delete comments.  The work to make sure they
don't conflicts with another need.  When changing the source, we delete
the old source fields and append the new which can cause some formatting
to be carried over unnecessarily.

For example, what would normally look like
```toml
cargo-list-test-fixture-dependency = { optional = true, path = "../dependency", version = "0.0.0" }
```
When fixed to preserve comments with my naive solution looks like
```toml
cargo-list-test-fixture-dependency = { optional = true , path = "../dependency", version = "0.0.0" }
```
Note that `optional = true` used to be last, so space separating it and
`}` was kept, now separating it and `,`.

More work will be needed to get this into an ideal state but we can at
least have confidence with inline tables for now.
2022-07-13 13:38:10 -05:00
..
in test(add): Ensure comments are preserved 2022-07-13 13:38:10 -05:00
out test(add): Ensure comments are preserved 2022-07-13 13:38:10 -05:00
mod.rs test(add): Ensure comments are preserved 2022-07-13 13:38:10 -05:00
stderr.log test(add): Ensure comments are preserved 2022-07-13 13:38:10 -05:00
stdout.log test(add): Ensure comments are preserved 2022-07-13 13:38:10 -05:00