-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: insert insta::allow_duplicates! { .. } per snapshot
This might be a bug of insta, but new snapshots were associated with wrong assertion blocks if allow_duplicates! { .. } contained multiple assertions.
- Loading branch information
Showing
3 changed files
with
33 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -815,6 +815,8 @@ fn test_workspaces_current_op_discarded_by_other(automatic: bool) { | |
let (stdout, stderr) = test_env.jj_cmd_ok(&secondary_path, &["st"]); | ||
insta::allow_duplicates! { | ||
insta::assert_snapshot!(stderr, @""); | ||
} | ||
insta::allow_duplicates! { | ||
insta::assert_snapshot!(stdout, @r###" | ||
Working copy changes: | ||
A added | ||
|
@@ -823,6 +825,8 @@ fn test_workspaces_current_op_discarded_by_other(automatic: bool) { | |
Working copy : kmkuslsw 15df8cb5 RECOVERY COMMIT FROM `jj workspace update-stale` | ||
Parent commit: rzvqmyuk 96b31daf (empty) (no description set) | ||
"###); | ||
} | ||
insta::allow_duplicates! { | ||
// The modified file should have the same contents it had before (not reset to | ||
// the base contents) | ||
insta::assert_snapshot!(std::fs::read_to_string(secondary_path.join("modified")).unwrap(), @r###" | ||
|
@@ -833,6 +837,8 @@ fn test_workspaces_current_op_discarded_by_other(automatic: bool) { | |
let (stdout, stderr) = test_env.jj_cmd_ok(&secondary_path, &["evolog"]); | ||
insta::allow_duplicates! { | ||
insta::assert_snapshot!(stderr, @""); | ||
} | ||
insta::allow_duplicates! { | ||
insta::assert_snapshot!(stdout, @r###" | ||
@ kmkuslsw [email protected] 2001-02-03 08:05:18 secondary@ 15df8cb5 | ||
│ RECOVERY COMMIT FROM `jj workspace update-stale` | ||
|