dart-decimate 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -64,6 +64,113 @@ fn resolves_package_imports_using_ancestor_package_config_from_member_root()
64
64
  Ok(())
65
65
  }
66
66
 
67
+ #[test]
68
+ fn nested_pubspec_missing_path_dependency_does_not_use_ancestor_package_config()
69
+ -> Result<(), Box<dyn std::error::Error>> {
70
+ let fixture = tempfile::tempdir()?;
71
+ write(&fixture, "pubspec.yaml", "name: app\n")?;
72
+ write(&fixture, "functions/worker/pubspec.yaml", "name: worker\n")?;
73
+ write(&fixture, "packages/shared/pubspec.yaml", "name: shared\n")?;
74
+ write(
75
+ &fixture,
76
+ ".dart_tool/package_config.json",
77
+ r#"{
78
+ "configVersion": 2,
79
+ "packages": [
80
+ {"name": "app", "rootUri": "../", "packageUri": "lib/"},
81
+ {"name": "shared", "rootUri": "../packages/shared", "packageUri": "lib/"}
82
+ ]
83
+ }
84
+ "#,
85
+ )?;
86
+ let worker = dart_file(
87
+ fixture.path().join("functions/worker/lib/worker.dart"),
88
+ "package:shared/shared.dart",
89
+ );
90
+ let shared = empty_dart_file(fixture.path().join("packages/shared/lib/shared.dart"));
91
+
92
+ let graph = build_module_graph(fixture.path(), &[worker, shared])?;
93
+
94
+ assert_eq!(graph.edge_count(), 0);
95
+ assert!(graph.unresolved().is_empty());
96
+
97
+ Ok(())
98
+ }
99
+
100
+ #[test]
101
+ fn nested_pubspec_missing_path_dependency_ignores_unowned_nested_pubspec()
102
+ -> Result<(), Box<dyn std::error::Error>> {
103
+ let fixture = tempfile::tempdir()?;
104
+ write(&fixture, "pubspec.yaml", "name: app\n")?;
105
+ write(&fixture, "functions/worker/pubspec.yaml", "name: worker\n")?;
106
+ write(&fixture, "functions/shared/pubspec.yaml", "name: shared\n")?;
107
+ write(
108
+ &fixture,
109
+ ".dart_tool/package_config.json",
110
+ r#"{
111
+ "configVersion": 2,
112
+ "packages": [
113
+ {"name": "app", "rootUri": "../", "packageUri": "lib/"}
114
+ ]
115
+ }
116
+ "#,
117
+ )?;
118
+ let worker = dart_file(
119
+ fixture.path().join("functions/worker/lib/worker.dart"),
120
+ "package:shared/shared.dart",
121
+ );
122
+ let shared = empty_dart_file(fixture.path().join("functions/shared/lib/shared.dart"));
123
+
124
+ let graph = build_module_graph(fixture.path(), &[worker, shared])?;
125
+
126
+ assert_eq!(graph.edge_count(), 0);
127
+ assert!(graph.unresolved().is_empty());
128
+
129
+ Ok(())
130
+ }
131
+
132
+ #[test]
133
+ fn nested_pubspec_path_dependency_resolves_before_ancestor_package_config()
134
+ -> Result<(), Box<dyn std::error::Error>> {
135
+ let fixture = tempfile::tempdir()?;
136
+ write(&fixture, "pubspec.yaml", "name: app\n")?;
137
+ write(
138
+ &fixture,
139
+ "functions/worker/pubspec.yaml",
140
+ "name: worker\ndependencies:\n shared:\n path: ../shared\n",
141
+ )?;
142
+ write(&fixture, "functions/shared/pubspec.yaml", "name: shared\n")?;
143
+ write(&fixture, "packages/shared/pubspec.yaml", "name: shared\n")?;
144
+ write(
145
+ &fixture,
146
+ ".dart_tool/package_config.json",
147
+ r#"{
148
+ "configVersion": 2,
149
+ "packages": [
150
+ {"name": "app", "rootUri": "../", "packageUri": "lib/"},
151
+ {"name": "shared", "rootUri": "../packages/shared", "packageUri": "lib/"}
152
+ ]
153
+ }
154
+ "#,
155
+ )?;
156
+ let worker = dart_file(
157
+ fixture.path().join("functions/worker/lib/worker.dart"),
158
+ "package:shared/shared.dart",
159
+ );
160
+ let local_shared = empty_dart_file(fixture.path().join("functions/shared/lib/shared.dart"));
161
+ let configured_shared = empty_dart_file(fixture.path().join("packages/shared/lib/shared.dart"));
162
+
163
+ let graph = build_module_graph(fixture.path(), &[worker, local_shared, configured_shared])?;
164
+
165
+ assert_eq!(graph.edge_count(), 1);
166
+ assert_eq!(
167
+ strip_root(fixture.path(), &graph.dependencies()[0].to_path),
168
+ PathBuf::from("functions/shared/lib/shared.dart")
169
+ );
170
+
171
+ Ok(())
172
+ }
173
+
67
174
  fn dart_file(path: PathBuf, import_uri: &str) -> DartFile {
68
175
  DartFile {
69
176
  path,
@@ -87,6 +194,22 @@ fn dart_file(path: PathBuf, import_uri: &str) -> DartFile {
87
194
  }
88
195
  }
89
196
 
197
+ fn empty_dart_file(path: PathBuf) -> DartFile {
198
+ DartFile {
199
+ path,
200
+ library: None,
201
+ part_of: None,
202
+ imports: Vec::new(),
203
+ exports: Vec::new(),
204
+ parts: Vec::new(),
205
+ declarations: Vec::new(),
206
+ members: Vec::new(),
207
+ references: Vec::new(),
208
+ signature_references: Vec::new(),
209
+ routes: Vec::new(),
210
+ }
211
+ }
212
+
90
213
  fn strip_root(root: &Path, path: &Path) -> PathBuf {
91
214
  path.strip_prefix(root).unwrap_or(path).to_path_buf()
92
215
  }
@@ -377,6 +377,131 @@ fn package_config_hosted_entries_remain_external() -> Result<(), Box<dyn std::er
377
377
  Ok(())
378
378
  }
379
379
 
380
+ #[test]
381
+ fn package_config_prevents_nested_same_name_fallback() -> Result<(), Box<dyn std::error::Error>> {
382
+ let fixture = Fixture::new()?;
383
+ fixture.write(
384
+ "pubspec.yaml",
385
+ "name: app\ndependencies:\n shared: ^1.0.0\n",
386
+ )?;
387
+ fixture.write("functions/a/shared/pubspec.yaml", "name: shared\n")?;
388
+ fixture.write(
389
+ ".dart_tool/package_config.json",
390
+ r#"{
391
+ "configVersion": 2,
392
+ "packages": [
393
+ {"name": "app", "rootUri": "../", "packageUri": "lib/"},
394
+ {"name": "shared", "rootUri": "file:///tmp/.pub-cache/hosted/shared-1.0.0", "packageUri": "lib/"}
395
+ ]
396
+ }
397
+ "#,
398
+ )?;
399
+ let main = fixture.file(
400
+ "lib/main.dart",
401
+ vec![import("package:shared/shared.dart")],
402
+ vec![],
403
+ );
404
+ let nested = fixture.file("functions/a/shared/lib/shared.dart", vec![], vec![]);
405
+
406
+ let graph = build_module_graph(fixture.root(), &[main, nested])?;
407
+
408
+ assert_eq!(graph.edge_count(), 0);
409
+ assert!(graph.unresolved().is_empty());
410
+
411
+ Ok(())
412
+ }
413
+
414
+ #[test]
415
+ fn package_config_owned_import_missing_from_config_ignores_nested_pubspec()
416
+ -> Result<(), Box<dyn std::error::Error>> {
417
+ let fixture = Fixture::new()?;
418
+ fixture.write("pubspec.yaml", "name: app\n")?;
419
+ fixture.write("functions/shared/pubspec.yaml", "name: shared\n")?;
420
+ fixture.write(
421
+ ".dart_tool/package_config.json",
422
+ r#"{
423
+ "configVersion": 2,
424
+ "packages": [
425
+ {"name": "app", "rootUri": "../", "packageUri": "lib/"}
426
+ ]
427
+ }
428
+ "#,
429
+ )?;
430
+ let main = fixture.file(
431
+ "lib/main.dart",
432
+ vec![import("package:shared/shared.dart")],
433
+ vec![],
434
+ );
435
+ let nested = fixture.file("functions/shared/lib/shared.dart", vec![], vec![]);
436
+
437
+ let graph = build_module_graph(fixture.root(), &[main, nested])?;
438
+
439
+ assert_eq!(graph.edge_count(), 0);
440
+ assert!(graph.unresolved().is_empty());
441
+
442
+ Ok(())
443
+ }
444
+
445
+ #[test]
446
+ fn package_config_ignores_malformed_unowned_nested_pubspec()
447
+ -> Result<(), Box<dyn std::error::Error>> {
448
+ let fixture = Fixture::new()?;
449
+ fixture.write("pubspec.yaml", "name: app\n")?;
450
+ fixture.write("fixtures/bad/pubspec.yaml", "name: [\n")?;
451
+ fixture.write(
452
+ ".dart_tool/package_config.json",
453
+ r#"{
454
+ "configVersion": 2,
455
+ "packages": [
456
+ {"name": "app", "rootUri": "../", "packageUri": "lib/"}
457
+ ]
458
+ }
459
+ "#,
460
+ )?;
461
+ let main = fixture.file("lib/main.dart", vec![], vec![]);
462
+
463
+ let graph = build_module_graph(fixture.root(), &[main])?;
464
+
465
+ assert_eq!(graph.package_names(), vec!["app"]);
466
+ assert_eq!(graph.edge_count(), 0);
467
+
468
+ Ok(())
469
+ }
470
+
471
+ #[test]
472
+ fn package_config_keeps_nested_self_imports_local() -> Result<(), Box<dyn std::error::Error>> {
473
+ let fixture = Fixture::new()?;
474
+ fixture.write("pubspec.yaml", "name: app\n")?;
475
+ fixture.write("functions/a/shared/pubspec.yaml", "name: shared\n")?;
476
+ fixture.write(
477
+ ".dart_tool/package_config.json",
478
+ r#"{
479
+ "configVersion": 2,
480
+ "packages": [
481
+ {"name": "app", "rootUri": "../", "packageUri": "lib/"},
482
+ {"name": "shared", "rootUri": "file:///tmp/.pub-cache/hosted/shared-1.0.0", "packageUri": "lib/"}
483
+ ]
484
+ }
485
+ "#,
486
+ )?;
487
+ let main = fixture.file(
488
+ "functions/a/shared/lib/main.dart",
489
+ vec![import("package:shared/src/foo.dart")],
490
+ vec![],
491
+ );
492
+ let foo = fixture.file("functions/a/shared/lib/src/foo.dart", vec![], vec![]);
493
+
494
+ let graph = build_module_graph(fixture.root(), &[main, foo])?;
495
+
496
+ assert_eq!(graph.edge_count(), 1);
497
+ assert_eq!(
498
+ strip_root(fixture.root(), &graph.dependencies()[0].to_path),
499
+ "functions/a/shared/lib/src/foo.dart"
500
+ );
501
+
502
+ Ok(())
503
+ }
504
+
380
505
  #[test]
381
506
  fn package_config_local_missing_target_is_unresolved() -> Result<(), Box<dyn std::error::Error>> {
382
507
  let fixture = Fixture::new()?;
package/src/graph.rs CHANGED
@@ -271,13 +271,14 @@ pub enum GraphError {
271
271
  /// Build a directed module graph from extracted Dart file facts.
272
272
  ///
273
273
  /// Local relative imports and exports are resolved from the source file's
274
- /// directory. `package:` imports resolve through local package names discovered
275
- /// from `pubspec.yaml` files, including pub workspaces and path dependencies.
274
+ /// directory. `package:` imports resolve through Pub package metadata,
275
+ /// including `.dart_tool/package_config.json`, workspaces, path dependencies,
276
+ /// same-package imports, and owner-local copied packages with duplicate names.
276
277
  ///
277
278
  /// # Errors
278
279
  ///
279
- /// Returns [`GraphError`] if a discovered `pubspec.yaml` cannot be read or
280
- /// parsed, or if a workspace glob entry is invalid.
280
+ /// Returns [`GraphError`] if package config or declared Pub package metadata
281
+ /// cannot be read or parsed, or if a workspace glob entry is invalid.
281
282
  pub fn build_module_graph(
282
283
  root: impl AsRef<Path>,
283
284
  files: &[DartFile],
@@ -547,7 +548,7 @@ pub(super) fn resolve_local_uri(
547
548
  let (package, path) = rest.split_once('/')?;
548
549
  let path = percent_decode_uri_path(path);
549
550
  return packages
550
- .resolve(package, &path)
551
+ .resolve_from(from_path, package, &path)
551
552
  .map(|resolution| ResolvedTarget {
552
553
  path: resolution.path,
553
554
  local: resolution.local,
@@ -86,7 +86,7 @@ fn feature_flag_finding(root: &Path, flag: &FeatureFlag) -> Finding {
86
86
  rule_id: "dart-decimate/feature-flag".to_owned(),
87
87
  fingerprint: Some(feature_flag_fingerprint(flag)),
88
88
  kind: FindingKind::FeatureFlag,
89
- severity: Severity::Error,
89
+ severity: feature_flag_severity(root, flag),
90
90
  message: format!(
91
91
  "Feature flag {} is referenced via {}",
92
92
  flag.name, flag.provider
@@ -111,6 +111,68 @@ fn feature_flag_finding(root: &Path, flag: &FeatureFlag) -> Finding {
111
111
  }
112
112
  }
113
113
 
114
+ fn feature_flag_severity(root: &Path, flag: &FeatureFlag) -> Severity {
115
+ if flag.source == FeatureFlagSource::CompileTimeEnvironment
116
+ && flag.occurrences.iter().all(|occurrence| {
117
+ let path = occurrence.path.as_path();
118
+ is_dev_or_test_path(root, path)
119
+ })
120
+ {
121
+ Severity::Warning
122
+ } else {
123
+ Severity::Error
124
+ }
125
+ }
126
+
127
+ fn is_dev_or_test_path(root: &Path, path: &Path) -> bool {
128
+ let relative = path.strip_prefix(root).unwrap_or(path);
129
+ let mut under_production_lib = false;
130
+ let mut saw_lib = false;
131
+ for component in relative
132
+ .components()
133
+ .filter_map(|component| component.as_os_str().to_str())
134
+ {
135
+ if matches!(
136
+ component,
137
+ "test"
138
+ | "tests"
139
+ | "integration_test"
140
+ | "test_driver"
141
+ | "tool"
142
+ | "scripts"
143
+ | "dev"
144
+ | "debug"
145
+ | "e2e"
146
+ | "example"
147
+ ) && !under_production_lib
148
+ {
149
+ return true;
150
+ }
151
+ if component == "lib" {
152
+ under_production_lib = true;
153
+ saw_lib = true;
154
+ }
155
+ }
156
+ if saw_lib {
157
+ return relative
158
+ .file_name()
159
+ .and_then(|file_name| file_name.to_str())
160
+ .is_some_and(is_non_production_flutter_entrypoint);
161
+ }
162
+ false
163
+ }
164
+
165
+ fn is_non_production_flutter_entrypoint(file_name: &str) -> bool {
166
+ matches!(
167
+ file_name,
168
+ "main_dev.dart"
169
+ | "main_debug.dart"
170
+ | "main_e2e.dart"
171
+ | "main_test.dart"
172
+ | "main_driver.dart"
173
+ )
174
+ }
175
+
114
176
  fn feature_flag_fingerprint(flag: &FeatureFlag) -> String {
115
177
  let text = format!("{}:{}:{}", flag.name, flag.provider, flag.source as u8);
116
178
  let mut hash = 0xcbf2_9ce4_8422_2325_u64;
@@ -52,15 +52,19 @@ pub(super) fn add_dead_code_findings(
52
52
  safe_to_delete: dead_file.safe_to_delete,
53
53
  files: Vec::new(),
54
54
  edge: None,
55
- actions: vec![
56
- FindingAction::new(
57
- "delete-file",
58
- "Delete the unreachable Dart file after confirming no dynamic entry point uses it",
59
- dead_file.safe_to_delete,
60
- )
61
- .with_target_path(path.clone())
62
- .with_dart_decimate_args(["inspect", "--format", "json", "--file", path.as_str()]),
63
- ],
55
+ actions: vec![FindingAction::new(
56
+ "delete-file",
57
+ "Delete the unreachable Dart file after confirming no dynamic entry point uses it",
58
+ dead_file.safe_to_delete,
59
+ )
60
+ .with_target_path(path.clone())
61
+ .with_dart_decimate_args([
62
+ "inspect",
63
+ "--format",
64
+ "json",
65
+ "--file",
66
+ path.as_str(),
67
+ ])],
64
68
  });
65
69
  }
66
70
  }
@@ -92,7 +96,7 @@ pub(super) fn add_cycle_findings(
92
96
  actions: vec![
93
97
  FindingAction::new(
94
98
  "break-cycle",
95
- "Move shared dependencies inward or invert one import edge",
99
+ "Inspect the cycle edge; split barrels or move shared ownership before expanding imports",
96
100
  false,
97
101
  )
98
102
  .with_target_path(path.clone())
@@ -251,17 +255,15 @@ pub(super) fn add_boundary_call_findings(
251
255
  safe_to_delete: false,
252
256
  files: vec![display_path(root, &violation.from_boundary)],
253
257
  edge: None,
254
- actions: vec![
255
- FindingAction::new(
256
- "repair-boundary-call",
257
- "Move the call behind an allowed boundary or replace it with an owned abstraction",
258
- false,
259
- )
260
- .with_target_path(path.clone())
261
- .with_config_key("boundary_calls")
262
- .with_value_schema("array of FROM:PATTERN forbidden direct call rules")
263
- .with_suppression_comment("// dart-decimate-ignore-next-line boundary-call-violation"),
264
- ],
258
+ actions: vec![FindingAction::new(
259
+ "repair-boundary-call",
260
+ "Move the call behind an allowed boundary or replace it with an owned abstraction",
261
+ false,
262
+ )
263
+ .with_target_path(path.clone())
264
+ .with_config_key("boundary_calls")
265
+ .with_value_schema("array of FROM:PATTERN forbidden direct call rules")
266
+ .with_suppression_comment("// dart-decimate-ignore-next-line boundary-call-violation")],
265
267
  });
266
268
  }
267
269
  }
@@ -196,7 +196,7 @@ pub(super) fn json_security_candidates(
196
196
  .iter()
197
197
  .map(|cwe| (*cwe).to_owned())
198
198
  .collect(),
199
- severity: Severity::Error,
199
+ severity: security_severity(candidate.category),
200
200
  candidate: JsonSecurityCandidateDetails {
201
201
  source: source_label(candidate.category).to_owned(),
202
202
  sink: candidate.sink.clone(),
@@ -261,7 +261,7 @@ fn security_finding(root: &Path, candidate: &SecurityCandidate) -> Finding {
261
261
  rule_id: candidate.rule_id.clone(),
262
262
  fingerprint: Some(security_fingerprint(candidate)),
263
263
  kind: FindingKind::SecurityCandidate,
264
- severity: Severity::Error,
264
+ severity: security_severity(candidate.category),
265
265
  message: format!(
266
266
  "Security review candidate for {} via {}",
267
267
  category_name(candidate.category),
@@ -287,6 +287,19 @@ fn security_finding(root: &Path, candidate: &SecurityCandidate) -> Finding {
287
287
  }
288
288
  }
289
289
 
290
+ const fn security_severity(category: SecurityCategory) -> Severity {
291
+ match category {
292
+ SecurityCategory::FirebaseApiKey => Severity::Warning,
293
+ SecurityCategory::HardcodedSecret
294
+ | SecurityCategory::InsecureTransport
295
+ | SecurityCategory::TlsBypass
296
+ | SecurityCategory::WebViewRisk
297
+ | SecurityCategory::ProcessExecution
298
+ | SecurityCategory::RawSql
299
+ | SecurityCategory::PlainSecretStorage => Severity::Error,
300
+ }
301
+ }
302
+
290
303
  fn attack_surface_entry(root: &Path, entry: &AttackSurfaceEntry) -> JsonAttackSurfaceEntry {
291
304
  JsonAttackSurfaceEntry {
292
305
  category: entry.category,
@@ -3,7 +3,9 @@ use std::fs;
3
3
  use tempfile::TempDir;
4
4
 
5
5
  use super::*;
6
- use crate::{analyze_symbols, find_dead_code, scan::scan_project};
6
+ use crate::{
7
+ FeatureFlagOptions, analyze_symbols, detect_feature_flags, find_dead_code, scan::scan_project,
8
+ };
7
9
 
8
10
  #[test]
9
11
  fn emits_agent_actionable_dead_file_findings() -> Result<(), Box<dyn std::error::Error>> {
@@ -105,6 +107,107 @@ fn emits_agent_actionable_duplicate_export_findings() -> Result<(), Box<dyn std:
105
107
  Ok(())
106
108
  }
107
109
 
110
+ #[test]
111
+ fn compile_time_feature_flag_severity_depends_on_path_not_name()
112
+ -> Result<(), Box<dyn std::error::Error>> {
113
+ let fixture = tempfile::tempdir()?;
114
+ write(&fixture, "pubspec.yaml", "name: app\n")?;
115
+ write(
116
+ &fixture,
117
+ "lib/main.dart",
118
+ "const variant = bool.fromEnvironment('AB_TEST_VARIANT');\n",
119
+ )?;
120
+ write(
121
+ &fixture,
122
+ "lib/dev_flags.dart",
123
+ "const debugFlag = bool.fromEnvironment('DEBUG_PROD_ONLY');\n",
124
+ )?;
125
+ write(
126
+ &fixture,
127
+ "lib/debug_flags.dart",
128
+ "const e2eFlag = bool.fromEnvironment('E2E_PROD_ONLY');\n",
129
+ )?;
130
+ write(
131
+ &fixture,
132
+ "lib/main_dev.dart",
133
+ "const e2eDevFlag = bool.fromEnvironment('E2E_DEV_ENTRY_ONLY');\n",
134
+ )?;
135
+ write(
136
+ &fixture,
137
+ "test/flag_test.dart",
138
+ "const debug = bool.fromEnvironment('DEBUG_TEST_ONLY');\n",
139
+ )?;
140
+ let project = scan_project(fixture.path())?;
141
+ let feature_flags = detect_feature_flags(&project, &FeatureFlagOptions::default())?;
142
+
143
+ let report = build_json_report(
144
+ &project,
145
+ &AnalysisResults {
146
+ command: ReportCommand::Check,
147
+ dead_code: None,
148
+ symbols: None,
149
+ cycles: Vec::new(),
150
+ re_export_cycles: Vec::new(),
151
+ boundary_violations: Vec::new(),
152
+ boundary_coverage: Vec::new(),
153
+ boundary_call_violations: Vec::new(),
154
+ policy_violations: Vec::new(),
155
+ dependency_hygiene: None,
156
+ duplicates: None,
157
+ health: None,
158
+ feature_flags: Some(feature_flags),
159
+ security: None,
160
+ routes: None,
161
+ widgets: None,
162
+ file_scope: None,
163
+ require_suppression_reasons: false,
164
+ },
165
+ );
166
+
167
+ assert_eq!(
168
+ report
169
+ .findings
170
+ .iter()
171
+ .find(|finding| finding.path == "lib/main.dart")
172
+ .map(|finding| finding.severity),
173
+ Some(Severity::Error)
174
+ );
175
+ assert_eq!(
176
+ report
177
+ .findings
178
+ .iter()
179
+ .find(|finding| finding.path == "lib/dev_flags.dart")
180
+ .map(|finding| finding.severity),
181
+ Some(Severity::Error)
182
+ );
183
+ assert_eq!(
184
+ report
185
+ .findings
186
+ .iter()
187
+ .find(|finding| finding.path == "lib/debug_flags.dart")
188
+ .map(|finding| finding.severity),
189
+ Some(Severity::Error)
190
+ );
191
+ assert_eq!(
192
+ report
193
+ .findings
194
+ .iter()
195
+ .find(|finding| finding.path == "lib/main_dev.dart")
196
+ .map(|finding| finding.severity),
197
+ Some(Severity::Warning)
198
+ );
199
+ assert_eq!(
200
+ report
201
+ .findings
202
+ .iter()
203
+ .find(|finding| finding.path == "test/flag_test.dart")
204
+ .map(|finding| finding.severity),
205
+ Some(Severity::Warning)
206
+ );
207
+
208
+ Ok(())
209
+ }
210
+
108
211
  fn write(fixture: &TempDir, path: &str, source: &str) -> Result<(), std::io::Error> {
109
212
  let path = fixture.path().join(path);
110
213
  if let Some(parent) = path.parent() {