Skip to content

Commit 5eae2d9

Browse files
committed
tests: run insta --force-update-snapshots
This is a replacement for #5558. Thanks to @yuja 's mitsuhiko/insta#722, this is now easy to generate.
1 parent 09f7613 commit 5eae2d9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+784
-832
lines changed

cli/src/git_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ mod tests {
702702
};
703703
// First output is after the initial delay
704704
assert_snapshot!(update(crate::progress::INITIAL_DELAY - Duration::from_millis(1), 0.1), @"");
705-
assert_snapshot!(update(Duration::from_millis(1), 0.10), @"[?25l\r 10% [█▊ ][K");
705+
assert_snapshot!(update(Duration::from_millis(1), 0.10), @"\u{1b}[?25l\r 10% [█▊ ]\u{1b}[K");
706706
// No updates for the next 30 milliseconds
707707
assert_snapshot!(update(Duration::from_millis(10), 0.11), @"");
708708
assert_snapshot!(update(Duration::from_millis(10), 0.12), @"");

cli/src/merge_tools/builtin.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ mod tests {
728728
ConflictMarkerStyle::Diff,
729729
)
730730
.unwrap();
731-
insta::assert_debug_snapshot!(files, @r###"
731+
insta::assert_debug_snapshot!(files, @r#"
732732
[
733733
File {
734734
old_path: None,
@@ -816,7 +816,7 @@ mod tests {
816816
],
817817
},
818818
]
819-
"###);
819+
"#);
820820

821821
let no_changes_tree_id = apply_diff_builtin(
822822
store,
@@ -865,7 +865,7 @@ mod tests {
865865
ConflictMarkerStyle::Diff,
866866
)
867867
.unwrap();
868-
insta::assert_debug_snapshot!(files, @r###"
868+
insta::assert_debug_snapshot!(files, @r#"
869869
[
870870
File {
871871
old_path: None,
@@ -888,7 +888,7 @@ mod tests {
888888
],
889889
},
890890
]
891-
"###);
891+
"#);
892892
let no_changes_tree_id = apply_diff_builtin(
893893
store,
894894
&left_tree,
@@ -936,7 +936,7 @@ mod tests {
936936
ConflictMarkerStyle::Diff,
937937
)
938938
.unwrap();
939-
insta::assert_debug_snapshot!(files, @r###"
939+
insta::assert_debug_snapshot!(files, @r#"
940940
[
941941
File {
942942
old_path: None,
@@ -959,7 +959,7 @@ mod tests {
959959
],
960960
},
961961
]
962-
"###);
962+
"#);
963963
let no_changes_tree_id = apply_diff_builtin(
964964
store,
965965
&left_tree,
@@ -1008,7 +1008,7 @@ mod tests {
10081008
ConflictMarkerStyle::Diff,
10091009
)
10101010
.unwrap();
1011-
insta::assert_debug_snapshot!(files, @r###"
1011+
insta::assert_debug_snapshot!(files, @r#"
10121012
[
10131013
File {
10141014
old_path: None,
@@ -1031,7 +1031,7 @@ mod tests {
10311031
],
10321032
},
10331033
]
1034-
"###);
1034+
"#);
10351035
let no_changes_tree_id = apply_diff_builtin(
10361036
store,
10371037
&left_tree,
@@ -1098,7 +1098,7 @@ mod tests {
10981098
.unwrap();
10991099
let merge_result = files::merge(&content);
11001100
let sections = make_merge_sections(merge_result).unwrap();
1101-
insta::assert_debug_snapshot!(sections, @r###"
1101+
insta::assert_debug_snapshot!(sections, @r#"
11021102
[
11031103
Changed {
11041104
lines: [
@@ -1146,6 +1146,6 @@ mod tests {
11461146
],
11471147
},
11481148
]
1149-
"###);
1149+
"#);
11501150
}
11511151
}

cli/src/merge_tools/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -703,11 +703,11 @@ mod tests {
703703
insta::assert_debug_snapshot!(get(":builtin", "").unwrap(), @"Builtin");
704704

705705
// Just program name
706-
insta::assert_debug_snapshot!(get("my diff", "").unwrap_err(), @r###"
706+
insta::assert_debug_snapshot!(get("my diff", "").unwrap_err(), @r#"
707707
MergeArgsNotConfigured {
708708
tool_name: "my diff",
709709
}
710-
"###);
710+
"#);
711711

712712
// Pick from merge-tools
713713
insta::assert_debug_snapshot!(get(
@@ -763,11 +763,11 @@ mod tests {
763763
insta::assert_debug_snapshot!(get("").unwrap(), @"Builtin");
764764

765765
// Just program name
766-
insta::assert_debug_snapshot!(get(r#"ui.merge-editor = "my-merge""#).unwrap_err(), @r###"
766+
insta::assert_debug_snapshot!(get(r#"ui.merge-editor = "my-merge""#).unwrap_err(), @r#"
767767
MergeArgsNotConfigured {
768768
tool_name: "my-merge",
769769
}
770-
"###);
770+
"#);
771771

772772
// String args
773773
insta::assert_debug_snapshot!(
@@ -871,11 +871,11 @@ mod tests {
871871

872872
// List args should never be a merge-tools key
873873
insta::assert_debug_snapshot!(
874-
get(r#"ui.merge-editor = ["meld"]"#).unwrap_err(), @r###"
874+
get(r#"ui.merge-editor = ["meld"]"#).unwrap_err(), @r#"
875875
MergeArgsNotConfigured {
876876
tool_name: "meld",
877877
}
878-
"###);
878+
"#);
879879

880880
// Invalid type
881881
assert!(get(r#"ui.merge-editor.k = 0"#).is_err());

0 commit comments

Comments
 (0)