Skip to content

Commit 2178cb7

Browse files
committed
Remove all quotes in insta tests
1 parent 38b0183 commit 2178cb7

File tree

5 files changed

+14
-23
lines changed

5 files changed

+14
-23
lines changed

crates/tmc-langs-cli/tests/integration.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,15 @@ fn test(f: impl Fn(&Path)) {
4646
// the yaml serialization doubles the backslashes so
4747
// we need to filter \\\\
4848
(r"\\\\", "/"),
49+
// remove quotes, some keys and values get quoted on Windows due to backslash path separators
50+
("\"", ""),
4951

5052
// replace all /tmp/ (linux), /var/ (macos) and C:/[..]/Temp/ (win) paths which vary each test run
5153
// note that we already turned \s to /s
5254
(r"/tmp/\S*", "[PATH]"),
5355
(r"/var/\S*", "[PATH]"),
5456
(r"C:/\S*/Temp/\S*", "[PATH]"),
5557
],
56-
redactions => vec![
57-
// strings containing backslashes get quoted which causes a mismatch between
58-
// Linux and Windows tests due to the different path separators,
59-
// so here we just unquote everything
60-
(".**", insta::dynamic_redaction(|value, _path| {
61-
let Some(s) = value.as_str() else {
62-
return value;
63-
};
64-
s.trim_matches('"').into()
65-
}))
66-
],
6758
}, {
6859
insta::glob!("sample_exercises/*/*", |exercise| {
6960
f(exercise)

crates/tmc-langs-cli/tests/snapshots/integration__checkstyle@java__ant-exercise.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ data:
1515
Arith.java:
1616
- column: 0
1717
line: 7
18-
message: "Indentation incorrect. Expected 4, but was 8."
18+
message: Indentation incorrect. Expected 4, but was 8.
1919
sourceName: com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck
2020

crates/tmc-langs-cli/tests/snapshots/integration__checkstyle@java__maven-exercise.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ data:
1515
fi/helsinki/cs/maventest/App.java:
1616
- column: 0
1717
line: 4
18-
message: "Indentation incorrect. Expected 4, but was 8."
18+
message: Indentation incorrect. Expected 4, but was 8.
1919
sourceName: com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck
2020

crates/tmc-langs-cli/tests/snapshots/integration__clean@java__ant-exercise-2.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ source: crates/tmc-langs-cli/tests/integration.rs
33
expression: files
44
input_file: crates/tmc-langs-cli/tests/sample_exercises/java/ant-exercise
55
---
6-
- ".tmcproject.json"
6+
- .tmcproject.json
77
- build.xml
88
- lib
99
- lib/edu-test-utils-0.4.1.jar

crates/tmc-langs-cli/tests/snapshots/integration__clean@java__maven-exercise-2.snap

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ source: crates/tmc-langs-cli/tests/integration.rs
33
expression: files
44
input_file: crates/tmc-langs-cli/tests/sample_exercises/java/maven-exercise
55
---
6-
- ".classpath"
7-
- ".factorypath"
8-
- ".project"
9-
- ".settings"
10-
- ".settings/org.eclipse.core.resources.prefs"
11-
- ".settings/org.eclipse.jdt.apt.core.prefs"
12-
- ".settings/org.eclipse.jdt.core.prefs"
13-
- ".settings/org.eclipse.m2e.core.prefs"
14-
- ".tmcproject.json"
6+
- .classpath
7+
- .factorypath
8+
- .project
9+
- .settings
10+
- .settings/org.eclipse.core.resources.prefs
11+
- .settings/org.eclipse.jdt.apt.core.prefs
12+
- .settings/org.eclipse.jdt.core.prefs
13+
- .settings/org.eclipse.m2e.core.prefs
14+
- .tmcproject.json
1515
- pom.xml
1616
- src
1717
- src/main

0 commit comments

Comments
 (0)