Skip to content

Commit dc066cd

Browse files
tests: run insta --force-update-snapshots
1 parent 07c63ed commit dc066cd

File tree

84 files changed

+4701
-5729
lines changed

Some content is hidden

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

84 files changed

+4701
-5729
lines changed

cli/src/formatter.rs

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ mod tests {
857857
formatter.pop_label().unwrap();
858858
write!(formatter, " after ").unwrap();
859859
drop(formatter);
860-
insta::assert_snapshot!(String::from_utf8(output).unwrap(), @" before [38;5;2m inside [39m after ");
860+
insta::assert_snapshot!(String::from_utf8(output).unwrap(), @" before [38;5;2m inside [39m after");
861861
}
862862

863863
#[test]
@@ -907,15 +907,15 @@ mod tests {
907907
formatter.pop_label().unwrap();
908908
writeln!(formatter).unwrap();
909909
drop(formatter);
910-
insta::assert_snapshot!(String::from_utf8(output).unwrap(), @r###"
910+
insta::assert_snapshot!(String::from_utf8(output).unwrap(), @r"
911911
 fg only 
912912
 bg only 
913913
 bold only 
914914
 italic only 
915915
 underlined only 
916916
 single rule 
917917
 two rules 
918-
"###);
918+
");
919919
}
920920

921921
#[test]
@@ -1005,7 +1005,7 @@ mod tests {
10051005
write!(formatter, " after outer ").unwrap();
10061006
drop(formatter);
10071007
insta::assert_snapshot!(String::from_utf8(output).unwrap(),
1008-
@" before outer [38;5;4m before inner [38;5;2m inside inner [38;5;4m after inner [39m after outer ");
1008+
@" before outer [38;5;4m before inner [38;5;2m inside inner [38;5;4m after inner [39m after outer");
10091009
}
10101010

10111011
#[test]
@@ -1027,7 +1027,7 @@ mod tests {
10271027
formatter.pop_label().unwrap();
10281028
drop(formatter);
10291029
insta::assert_snapshot!(String::from_utf8(output).unwrap(),
1030-
@" not colored [38;5;2m colored [39m not colored ");
1030+
@" not colored [38;5;2m colored [39m not colored");
10311031
}
10321032

10331033
#[test]
@@ -1106,10 +1106,10 @@ mod tests {
11061106
write!(formatter, " and back.").unwrap();
11071107
drop(formatter);
11081108
insta::assert_snapshot!(String::from_utf8(output).unwrap(),
1109-
@r###"
1109+
@r"
11101110
Blue on yellow,  default fg,  and back.
11111111
Blue on yellow,  default bg,  and back.
1112-
"###);
1112+
");
11131113
}
11141114

11151115
#[test]
@@ -1149,7 +1149,7 @@ mod tests {
11491149
formatter.pop_label().unwrap();
11501150
formatter.pop_label().unwrap();
11511151
drop(formatter);
1152-
insta::assert_snapshot!(String::from_utf8(output).unwrap(), @" hello ");
1152+
insta::assert_snapshot!(String::from_utf8(output).unwrap(), @" hello");
11531153
}
11541154

11551155
#[test]
@@ -1241,9 +1241,7 @@ mod tests {
12411241
write!(writer, "Message").unwrap();
12421242
writeln!(writer, " continues").unwrap();
12431243
drop(formatter);
1244-
insta::assert_snapshot!(String::from_utf8(output).unwrap(), @r###"
1245-
Heading: Message continues
1246-
"###);
1244+
insta::assert_snapshot!(String::from_utf8(output).unwrap(), @"Heading: Message continues");
12471245
}
12481246

12491247
#[test]
@@ -1259,7 +1257,7 @@ mod tests {
12591257
write!(writer, "").unwrap();
12601258
write!(writer, "").unwrap();
12611259
drop(formatter);
1262-
insta::assert_snapshot!(String::from_utf8(output).unwrap(), @"Heading: ");
1260+
insta::assert_snapshot!(String::from_utf8(output).unwrap(), @"Heading:");
12631261
}
12641262

12651263
#[test]
@@ -1274,7 +1272,7 @@ mod tests {
12741272

12751273
insta::assert_snapshot!(
12761274
str::from_utf8(recorder.data()).unwrap(),
1277-
@" outer1 inner1 inner2 outer2 ");
1275+
@" outer1 inner1 inner2 outer2");
12781276

12791277
// Replayed output should be labeled.
12801278
let config = config_from_string(r#" colors.inner = "red" "#);
@@ -1284,7 +1282,7 @@ mod tests {
12841282
drop(formatter);
12851283
insta::assert_snapshot!(
12861284
String::from_utf8(output).unwrap(),
1287-
@" outer1 [38;5;1m inner1 inner2 [39m outer2 ");
1285+
@" outer1 [38;5;1m inner1 inner2 [39m outer2");
12881286

12891287
// Replayed output should be split at push/pop_label() call.
12901288
let mut output: Vec<u8> = vec![];
@@ -1319,7 +1317,7 @@ mod tests {
13191317
recorder.replay(&mut formatter).unwrap();
13201318
drop(formatter);
13211319
insta::assert_snapshot!(
1322-
String::from_utf8(output).unwrap(), @" outer1 [38;5;1m inner1 inner2 [39m outer2 ");
1320+
String::from_utf8(output).unwrap(), @" outer1 [38;5;1m inner1 inner2 [39m outer2");
13231321

13241322
let mut output: Vec<u8> = vec![];
13251323
let mut formatter = ColorFormatter::for_config(&mut output, &config, false).unwrap();
@@ -1333,6 +1331,6 @@ mod tests {
13331331
.unwrap();
13341332
drop(formatter);
13351333
insta::assert_snapshot!(
1336-
String::from_utf8(output).unwrap(), @" outer1 [38;5;1m inner1 inner2 [39m outer2 ");
1334+
String::from_utf8(output).unwrap(), @" outer1 [38;5;1m inner1 inner2 [39m outer2");
13371335
}
13381336
}

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
@@ -733,7 +733,7 @@ mod tests {
733733
ConflictMarkerStyle::Diff,
734734
)
735735
.unwrap();
736-
insta::assert_debug_snapshot!(files, @r###"
736+
insta::assert_debug_snapshot!(files, @r#"
737737
[
738738
File {
739739
old_path: None,
@@ -821,7 +821,7 @@ mod tests {
821821
],
822822
},
823823
]
824-
"###);
824+
"#);
825825

826826
let no_changes_tree_id = apply_diff_builtin(
827827
store,
@@ -870,7 +870,7 @@ mod tests {
870870
ConflictMarkerStyle::Diff,
871871
)
872872
.unwrap();
873-
insta::assert_debug_snapshot!(files, @r###"
873+
insta::assert_debug_snapshot!(files, @r#"
874874
[
875875
File {
876876
old_path: None,
@@ -893,7 +893,7 @@ mod tests {
893893
],
894894
},
895895
]
896-
"###);
896+
"#);
897897
let no_changes_tree_id = apply_diff_builtin(
898898
store,
899899
&left_tree,
@@ -941,7 +941,7 @@ mod tests {
941941
ConflictMarkerStyle::Diff,
942942
)
943943
.unwrap();
944-
insta::assert_debug_snapshot!(files, @r###"
944+
insta::assert_debug_snapshot!(files, @r#"
945945
[
946946
File {
947947
old_path: None,
@@ -964,7 +964,7 @@ mod tests {
964964
],
965965
},
966966
]
967-
"###);
967+
"#);
968968
let no_changes_tree_id = apply_diff_builtin(
969969
store,
970970
&left_tree,
@@ -1013,7 +1013,7 @@ mod tests {
10131013
ConflictMarkerStyle::Diff,
10141014
)
10151015
.unwrap();
1016-
insta::assert_debug_snapshot!(files, @r###"
1016+
insta::assert_debug_snapshot!(files, @r#"
10171017
[
10181018
File {
10191019
old_path: None,
@@ -1036,7 +1036,7 @@ mod tests {
10361036
],
10371037
},
10381038
]
1039-
"###);
1039+
"#);
10401040
let no_changes_tree_id = apply_diff_builtin(
10411041
store,
10421042
&left_tree,
@@ -1103,7 +1103,7 @@ mod tests {
11031103
.unwrap();
11041104
let merge_result = files::merge(&content);
11051105
let sections = make_merge_sections(merge_result).unwrap();
1106-
insta::assert_debug_snapshot!(sections, @r###"
1106+
insta::assert_debug_snapshot!(sections, @r#"
11071107
[
11081108
Changed {
11091109
lines: [
@@ -1151,6 +1151,6 @@ mod tests {
11511151
],
11521152
},
11531153
]
1154-
"###);
1154+
"#);
11551155
}
11561156
}

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)