Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
805f075
Enforce starting newlines
max-sixty Sep 21, 2024
a6d109a
max-sixty Sep 21, 2024
09e0537
Merge branch 'master' into trimming
max-sixty Sep 22, 2024
1521a84
max-sixty Sep 22, 2024
e9b4d63
max-sixty Sep 22, 2024
2beb01f
max-sixty Sep 22, 2024
3ec622e
Merge branch 'master' into trimming
max-sixty Oct 3, 2024
348d370
Merge branch 'master' into trimming
max-sixty Oct 5, 2024
606aa20
max-sixty Oct 5, 2024
6484646
max-sixty Oct 5, 2024
c2c5405
Merge branch 'master' into trimming
max-sixty Oct 6, 2024
fefb570
Merge branch 'master' into trimming
max-sixty Oct 12, 2024
0bd6e80
Merge branch 'master' into trimming
max-sixty Oct 12, 2024
d96338b
Merge branch 'master' into trimming
max-sixty Jan 4, 2025
3d54936
max-sixty Jan 4, 2025
2ef8bbc
Merge branch 'master' into trimming
max-sixty Feb 1, 2025
167cdb5
Merge master into trimming branch
max-sixty Sep 10, 2025
88a5cc0
Successfully merge master and add comprehensive trimming tests
max-sixty Sep 10, 2025
4924bfb
Add changelog entry for inline snapshot trimming feature
max-sixty Sep 10, 2025
2d11ce6
Fix: Remove trailing whitespace in test files
max-sixty Sep 10, 2025
127bff8
Merge master and resolve CHANGELOG conflicts
max-sixty Sep 10, 2025
73d54d0
Add comprehensive indentation trimming tests
max-sixty Sep 10, 2025
76378e5
Fix trimming tests to properly test the behavior
max-sixty Sep 10, 2025
e297f26
Apply rustfmt formatting
max-sixty Sep 10, 2025
c68adbb
Consolidate trimming tests into single file
max-sixty Sep 10, 2025
f88247c
Add comprehensive edge case tests for trimming
max-sixty Sep 10, 2025
c17a028
Add critical backwards compatibility tests
max-sixty Sep 10, 2025
b3eedde
Consolidate all trimming tests into single comprehensive file
max-sixty Sep 10, 2025
6012b67
Fix rustfmt issues in trimming tests
max-sixty Sep 10, 2025
feb94f1
Improve changelog entry for indentation trimming
max-sixty Sep 10, 2025
dedf588
Restore original changelog entry for trimming feature
max-sixty Sep 10, 2025
4c9f88e
Move indentation trimming changelog entry from 1.41.0 to Unreleased
max-sixty Sep 10, 2025
ae9db58
Add changelog entry for indentation trimming feature
max-sixty Sep 10, 2025
9db020b
Update changelog for leading newline assertion change
max-sixty Sep 10, 2025
70a962c
Fix changelog entry for indentation trimming
max-sixty Sep 10, 2025
a225e18
Revert "Fix changelog entry for indentation trimming"
max-sixty Sep 10, 2025
85ae73e
Refactor inline snapshot tests to focus on actual new feature
max-sixty Sep 10, 2025
1a96e32
Fix clippy lints in inline snapshot tests
max-sixty Sep 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ All notable changes to insta and cargo-insta are documented here.
nextest. Shows a deprecation warning when nextest is used with doctests without this flag, to prepare `cargo insta` to no longer run
a separate doctest process when using nextest in the future. #803

- We no longer trim starting newlines during assertions, which allows asserting
the number of leading newlines match. Existing assertions with different
leading newlines will pass and print a warning suggesting running with
`--force-update-snapshots`. They may fail in the future. (Note that we still
currently allow differing _trailing_ newlines, though may adjust this in the
future). #563


## 1.43.2

- Fix panics when `cargo metadata` fails to execute or parse (e.g., when cargo is not in PATH or returns invalid output). Now falls back to using the manifest directory as the workspace root. #798 (@adriangb)
Expand Down
33 changes: 11 additions & 22 deletions cargo-insta/tests/functional/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ fn test_binary_snapshot() {
assert_snapshot!(test_project.file_tree_diff(), @r"
--- Original file tree
+++ Updated file tree
@@ -1,4 +1,8 @@

@@ -1,3 +1,7 @@
+ Cargo.lock
Cargo.toml
src
Expand Down Expand Up @@ -66,8 +65,7 @@ fn test_binary_snapshot() {
assert_snapshot!(test_project.file_tree_diff(), @r"
--- Original file tree
+++ Updated file tree
@@ -1,4 +1,8 @@

@@ -1,3 +1,7 @@
+ Cargo.lock
Cargo.toml
src
Expand Down Expand Up @@ -123,8 +121,7 @@ fn test_binary_snapshot() {
assert_snapshot!(test_project.file_tree_diff(), @r"
--- Original file tree
+++ Updated file tree
@@ -1,4 +1,10 @@

@@ -1,3 +1,9 @@
+ Cargo.lock
Cargo.toml
src
Expand All @@ -147,8 +144,7 @@ fn test_binary_snapshot() {
assert_snapshot!(test_project.file_tree_diff(), @r"
--- Original file tree
+++ Updated file tree
@@ -1,4 +1,8 @@

@@ -1,3 +1,7 @@
+ Cargo.lock
Cargo.toml
src
Expand Down Expand Up @@ -199,8 +195,7 @@ fn test_binary_snapshot() {
assert_snapshot!(test_project.file_tree_diff(), @r"
--- Original file tree
+++ Updated file tree
@@ -1,4 +1,6 @@

@@ -1,3 +1,5 @@
+ Cargo.lock
Cargo.toml
src
Expand Down Expand Up @@ -237,8 +232,7 @@ fn test() {
assert_snapshot!(test_project.file_tree_diff(), @r"
--- Original file tree
+++ Updated file tree
@@ -1,4 +1,7 @@

@@ -1,3 +1,6 @@
+ Cargo.lock
Cargo.toml
src
Expand Down Expand Up @@ -268,8 +262,7 @@ fn test() {
assert_snapshot!(test_project.file_tree_diff(), @r"
--- Original file tree
+++ Updated file tree
@@ -1,4 +1,8 @@

@@ -1,3 +1,7 @@
+ Cargo.lock
Cargo.toml
src
Expand Down Expand Up @@ -308,8 +301,7 @@ fn test() {
assert_snapshot!(test_project.file_tree_diff(), @r"
--- Original file tree
+++ Updated file tree
@@ -1,4 +1,8 @@

@@ -1,3 +1,7 @@
+ Cargo.lock
Cargo.toml
src
Expand Down Expand Up @@ -340,8 +332,7 @@ fn test() {
assert_snapshot!(test_project.file_tree_diff(), @r"
--- Original file tree
+++ Updated file tree
@@ -1,4 +1,7 @@

@@ -1,3 +1,6 @@
+ Cargo.lock
Cargo.toml
src
Expand Down Expand Up @@ -381,8 +372,7 @@ fn test_snapshot() {
assert_snapshot!(test_project.file_tree_diff(), @r"
--- Original file tree
+++ Updated file tree
@@ -1,4 +1,8 @@

@@ -1,3 +1,7 @@
+ Cargo.lock
Cargo.toml
src
Expand Down Expand Up @@ -411,8 +401,7 @@ fn test_snapshot() {
assert_snapshot!(test_project.file_tree_diff(), @r"
--- Original file tree
+++ Updated file tree
@@ -1,4 +1,6 @@

@@ -1,3 +1,5 @@
+ Cargo.lock
Cargo.toml
src
Expand Down
21 changes: 7 additions & 14 deletions cargo-insta/tests/functional/delete_pending.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ fn test_snapshot_file() {
assert_snapshot!(test_project.file_tree_diff(), @r"
--- Original file tree
+++ Updated file tree
@@ -1,4 +1,7 @@

@@ -1,3 +1,6 @@
+ Cargo.lock
Cargo.toml
src
Expand All @@ -70,8 +69,7 @@ fn test_snapshot_file() {
assert_snapshot!(test_project.file_tree_diff(), @r"
--- Original file tree
+++ Updated file tree
@@ -1,4 +1,6 @@

@@ -1,3 +1,5 @@
+ Cargo.lock
Cargo.toml
src
Expand Down Expand Up @@ -116,8 +114,7 @@ fn test_file_snapshot() {
assert_snapshot!(test_project.file_tree_diff(), @r"
--- Original file tree
+++ Updated file tree
@@ -1,4 +1,7 @@

@@ -1,3 +1,6 @@
+ Cargo.lock
Cargo.toml
src
Expand Down Expand Up @@ -158,8 +155,7 @@ fn test_file_snapshot() {
assert_snapshot!(test_project.file_tree_diff(), @r"
--- Original file tree
+++ Updated file tree
@@ -1,4 +1,9 @@

@@ -1,3 +1,8 @@
+ Cargo.lock
Cargo.toml
src
Expand All @@ -183,8 +179,7 @@ fn test_file_snapshot() {
assert_snapshot!(test_project.file_tree_diff(), @r"
--- Original file tree
+++ Updated file tree
@@ -1,4 +1,7 @@

@@ -1,3 +1,6 @@
+ Cargo.lock
Cargo.toml
src
Expand All @@ -206,8 +201,7 @@ fn test_file_snapshot() {
assert_snapshot!(test_project.file_tree_diff(), @r"
--- Original file tree
+++ Updated file tree
@@ -1,4 +1,9 @@

@@ -1,3 +1,8 @@
+ Cargo.lock
Cargo.toml
src
Expand Down Expand Up @@ -250,8 +244,7 @@ fn test_file_snapshot() {
assert_snapshot!(test_project.file_tree_diff(), @r"
--- Original file tree
+++ Updated file tree
@@ -1,4 +1,7 @@

@@ -1,3 +1,6 @@
+ Cargo.lock
Cargo.toml
src
Expand Down
Loading
Loading