Normalize test snapshots (#17486)
This reduces the churn when changing test snapshots, as insta updates the quotes when the contents change. Instead, we decouple it by updating the quotes in bulk here. Created by: ``` cargo insta test --accept --force-update-snapshots ```
This commit is contained in:
@@ -305,7 +305,7 @@ mod tests {
|
||||
let real_prefix = Path::new("/real/prefix");
|
||||
let data = patch_sysconfigdata(sysconfigdata, real_prefix);
|
||||
|
||||
insta::assert_snapshot!(data.to_string_pretty()?, @r###"
|
||||
insta::assert_snapshot!(data.to_string_pretty()?, @r#"
|
||||
# system configuration generated and used by the sysconfig module
|
||||
build_time_vars = {
|
||||
"BASEMODLIBS": "",
|
||||
@@ -318,7 +318,7 @@ mod tests {
|
||||
"exec_prefix": "/real/prefix/exec_prefix",
|
||||
"prefix": "/real/prefix/prefix"
|
||||
}
|
||||
"###);
|
||||
"#);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -337,7 +337,7 @@ mod tests {
|
||||
let real_prefix = Path::new("/real/prefix");
|
||||
let data = patch_sysconfigdata(sysconfigdata, real_prefix);
|
||||
|
||||
insta::assert_snapshot!(data.to_string_pretty()?, @r##"
|
||||
insta::assert_snapshot!(data.to_string_pretty()?, @r#"
|
||||
# system configuration generated and used by the sysconfig module
|
||||
build_time_vars = {
|
||||
"AR": "ar",
|
||||
@@ -345,7 +345,7 @@ mod tests {
|
||||
"CXX": "c++ -pthread",
|
||||
"PYTHON_BUILD_STANDALONE": 1
|
||||
}
|
||||
"##);
|
||||
"#);
|
||||
|
||||
// Cross-compiles use GNU
|
||||
let sysconfigdata = [
|
||||
@@ -359,14 +359,14 @@ mod tests {
|
||||
let real_prefix = Path::new("/real/prefix");
|
||||
let data = patch_sysconfigdata(sysconfigdata, real_prefix);
|
||||
|
||||
insta::assert_snapshot!(data.to_string_pretty()?, @r##"
|
||||
insta::assert_snapshot!(data.to_string_pretty()?, @r#"
|
||||
# system configuration generated and used by the sysconfig module
|
||||
build_time_vars = {
|
||||
"CC": "cc",
|
||||
"CXX": "c++",
|
||||
"PYTHON_BUILD_STANDALONE": 1
|
||||
}
|
||||
"##);
|
||||
"#);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -383,13 +383,13 @@ mod tests {
|
||||
let real_prefix = Path::new("/real/prefix");
|
||||
let data = patch_sysconfigdata(sysconfigdata, real_prefix);
|
||||
|
||||
insta::assert_snapshot!(data.to_string_pretty()?, @r###"
|
||||
insta::assert_snapshot!(data.to_string_pretty()?, @r#"
|
||||
# system configuration generated and used by the sysconfig module
|
||||
build_time_vars = {
|
||||
"BLDSHARED": "cc -bundle -undefined dynamic_lookup -arch arm64",
|
||||
"PYTHON_BUILD_STANDALONE": 1
|
||||
}
|
||||
"###);
|
||||
"#);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -416,7 +416,7 @@ mod tests {
|
||||
|
||||
let pkgconfig = patch_pkgconfig(pkgconfig).unwrap();
|
||||
|
||||
insta::assert_snapshot!(pkgconfig, @r###"
|
||||
insta::assert_snapshot!(pkgconfig, @"
|
||||
# See: man pkg-config
|
||||
prefix=${pcfiledir}/../..
|
||||
exec_prefix=${prefix}
|
||||
@@ -430,6 +430,6 @@ mod tests {
|
||||
Libs.private: -ldl -framework CoreFoundation
|
||||
Libs:
|
||||
Cflags: -I${includedir}/python3.10
|
||||
"###);
|
||||
");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,14 +287,14 @@ mod tests {
|
||||
let result = input.parse::<SysconfigData>().expect("Parsing failed");
|
||||
let snapshot = result.to_string_pretty().unwrap();
|
||||
|
||||
insta::assert_snapshot!(snapshot, @r###"
|
||||
insta::assert_snapshot!(snapshot, @r#"
|
||||
# system configuration generated and used by the sysconfig module
|
||||
build_time_vars = {
|
||||
"key1": "value1",
|
||||
"key2": 42,
|
||||
"key3": "multi-part string"
|
||||
}
|
||||
"###);
|
||||
"#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -314,7 +314,7 @@ mod tests {
|
||||
let result = input.parse::<SysconfigData>().expect("Parsing failed");
|
||||
let snapshot = result.to_string_pretty().unwrap();
|
||||
|
||||
insta::assert_snapshot!(snapshot, @r###"
|
||||
insta::assert_snapshot!(snapshot, @r#"
|
||||
# system configuration generated and used by the sysconfig module
|
||||
build_time_vars = {
|
||||
"key1": "value1\"value2\"value3",
|
||||
@@ -322,7 +322,7 @@ mod tests {
|
||||
"key3": "value1\\\"value2\\\"value3",
|
||||
"key4": "value1\\\\value2\\\\value3"
|
||||
}
|
||||
"###);
|
||||
"#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -371,14 +371,14 @@ mod tests {
|
||||
let result = input.parse::<SysconfigData>().expect("Parsing failed");
|
||||
let snapshot = result.to_string_pretty().unwrap();
|
||||
|
||||
insta::assert_snapshot!(snapshot, @r###"
|
||||
insta::assert_snapshot!(snapshot, @r#"
|
||||
# system configuration generated and used by the sysconfig module
|
||||
build_time_vars = {
|
||||
"key1": "value1",
|
||||
"key2": 42,
|
||||
"key3": "multi-part string"
|
||||
}
|
||||
"###);
|
||||
"#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -396,13 +396,13 @@ mod tests {
|
||||
let result = input.parse::<SysconfigData>().expect("Parsing failed");
|
||||
let snapshot = result.to_string_pretty().unwrap();
|
||||
|
||||
insta::assert_snapshot!(snapshot, @r###"
|
||||
insta::assert_snapshot!(snapshot, @r#"
|
||||
# system configuration generated and used by the sysconfig module
|
||||
build_time_vars = {
|
||||
"key1": 12345,
|
||||
"key2": -15
|
||||
}
|
||||
"###);
|
||||
"#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -420,13 +420,13 @@ mod tests {
|
||||
let result = input.parse::<SysconfigData>().expect("Parsing failed");
|
||||
let snapshot = result.to_string_pretty().unwrap();
|
||||
|
||||
insta::assert_snapshot!(snapshot, @r###"
|
||||
insta::assert_snapshot!(snapshot, @r#"
|
||||
# system configuration generated and used by the sysconfig module
|
||||
build_time_vars = {
|
||||
"key1": "value with \"escaped quotes\"",
|
||||
"key2": "single-quoted 'escaped'"
|
||||
}
|
||||
"###);
|
||||
"#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -445,12 +445,12 @@ mod tests {
|
||||
let result = input.parse::<SysconfigData>().expect("Parsing failed");
|
||||
let snapshot = result.to_string_pretty().unwrap();
|
||||
|
||||
insta::assert_snapshot!(snapshot, @r###"
|
||||
insta::assert_snapshot!(snapshot, @r#"
|
||||
# system configuration generated and used by the sysconfig module
|
||||
build_time_vars = {
|
||||
"key1": "multi-line string"
|
||||
}
|
||||
"###);
|
||||
"#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user