perl-module 0.16.0

Perl module resolution, import analysis, and refactoring — unified facade
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
//! Extended unit tests for the `perl-module-path` crate.
//!
//! This test suite provides additional coverage beyond comprehensive_unit_tests.rs,
//! including:
//! - Additional edge cases and boundary conditions
//! - Complex path scenarios with multiple separators
//! - Library path extraction with unusual layouts
//! - Performance and correctness with large inputs
//! - Special characters and encoding edge cases

use perl_module::path::{
    file_path_to_module_name, module_name_to_path, module_path_to_name, normalize_package_separator,
};

// ── normalize_package_separator: Additional edge cases ─────────────────

#[test]
fn normalize_single_apostrophe_only() -> Result<(), Box<dyn std::error::Error>> {
    let result = normalize_package_separator("'");
    assert_eq!(result, "::");
    Ok(())
}

#[test]
fn normalize_multiple_consecutive_apostrophes() -> Result<(), Box<dyn std::error::Error>> {
    let result = normalize_package_separator("A'''B");
    // Three apostrophes each become ::, so we get six colons
    assert_eq!(result, "A::::::B");
    Ok(())
}

#[test]
fn normalize_leading_apostrophe() -> Result<(), Box<dyn std::error::Error>> {
    let result = normalize_package_separator("'Package");
    assert_eq!(result, "::Package");
    Ok(())
}

#[test]
fn normalize_trailing_apostrophe() -> Result<(), Box<dyn std::error::Error>> {
    let result = normalize_package_separator("Package'");
    assert_eq!(result, "Package::");
    Ok(())
}

#[test]
fn normalize_leading_trailing_apostrophes() -> Result<(), Box<dyn std::error::Error>> {
    let result = normalize_package_separator("'Package'");
    assert_eq!(result, "::Package::");
    Ok(())
}

#[test]
fn normalize_apostrophe_with_numbers() -> Result<(), Box<dyn std::error::Error>> {
    let result = normalize_package_separator("Mod1'Mod2'Mod3");
    assert_eq!(result, "Mod1::Mod2::Mod3");
    Ok(())
}

#[test]
fn normalize_apostrophe_with_underscores() -> Result<(), Box<dyn std::error::Error>> {
    let result = normalize_package_separator("Mod_1'Mod_2'Mod_3");
    assert_eq!(result, "Mod_1::Mod_2::Mod_3");
    Ok(())
}

#[test]
fn normalize_very_long_package_with_ticks() -> Result<(), Box<dyn std::error::Error>> {
    let result = normalize_package_separator("A'B'C'D'E'F'G'H'I'J");
    assert_eq!(result, "A::B::C::D::E::F::G::H::I::J");
    Ok(())
}

// ── module_name_to_path: Additional depth and structure tests ─────────

#[test]
fn name_to_path_underscore_in_segment() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_name_to_path("My_Module::Sub_Module"), "My_Module/Sub_Module.pm");
    Ok(())
}

#[test]
fn name_to_path_numbers_in_segments() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_name_to_path("Foo123::Bar456"), "Foo123/Bar456.pm");
    Ok(())
}

#[test]
fn name_to_path_mixed_case() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(
        module_name_to_path("MyModule::subModule::SubSubModule"),
        "MyModule/subModule/SubSubModule.pm"
    );
    Ok(())
}

#[test]
fn name_to_path_lowercase_module() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_name_to_path("perl::io"), "perl/io.pm");
    Ok(())
}

#[test]
fn name_to_path_uppercase_single_char() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_name_to_path("A::B::C::D::E::F::G::H"), "A/B/C/D/E/F/G/H.pm");
    Ok(())
}

#[test]
fn name_to_path_very_long_segment() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(
        module_name_to_path("VeryLongModuleName::AnotherVeryLongSegment::YetAnother"),
        "VeryLongModuleName/AnotherVeryLongSegment/YetAnother.pm"
    );
    Ok(())
}

#[test]
fn name_to_path_ten_level_deep() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(
        module_name_to_path("L1::L2::L3::L4::L5::L6::L7::L8::L9::L10"),
        "L1/L2/L3/L4/L5/L6/L7/L8/L9/L10.pm"
    );
    Ok(())
}

#[test]
fn name_to_path_single_colon_pairs_consecutive() -> Result<(), Box<dyn std::error::Error>> {
    // Extra colons create empty segments which become empty path components
    assert_eq!(module_name_to_path("A::B::C"), "A/B/C.pm");
    Ok(())
}

#[test]
fn name_to_path_hyphen_in_module() -> Result<(), Box<dyn std::error::Error>> {
    // Hyphens are allowed in Perl module names (though unusual)
    assert_eq!(module_name_to_path("My-Module::Sub"), "My-Module/Sub.pm");
    Ok(())
}

// ── module_path_to_name: Additional path scenarios ────────────────────

#[test]
fn path_to_name_multiple_extensions_only_last_stripped() -> Result<(), Box<dyn std::error::Error>> {
    // Only .pm or .pl at the end are stripped, not in the middle
    assert_eq!(module_path_to_name("Foo.pm/Bar.pm"), "Foo.pm::Bar");
    Ok(())
}

#[test]
fn path_to_name_many_slashes_and_backslashes() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_path_to_name(r"A/B\C/D\E.pm"), "A::B::C::D::E");
    Ok(())
}

#[test]
fn path_to_name_leading_slash() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_path_to_name("/Foo/Bar.pm"), "::Foo::Bar");
    Ok(())
}

#[test]
fn path_to_name_trailing_slash() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_path_to_name("Foo/Bar/.pm"), "Foo::Bar::"); // Empty final segment before .pm
    Ok(())
}

#[test]
fn path_to_name_only_slashes() -> Result<(), Box<dyn std::error::Error>> {
    // Three slashes create three segments: "", "", "", and "" which become colons
    assert_eq!(module_path_to_name("///"), "::::::");
    Ok(())
}

#[test]
fn path_to_name_only_backslashes() -> Result<(), Box<dyn std::error::Error>> {
    // Three backslashes converted to slashes create three segments which become colons
    assert_eq!(module_path_to_name(r"\\\"), "::::::");
    Ok(())
}

#[test]
fn path_to_name_dot_without_extension() -> Result<(), Box<dyn std::error::Error>> {
    // A dot not followed by pm or pl is preserved
    assert_eq!(module_path_to_name("Foo.Other/Bar.pm"), "Foo.Other::Bar");
    Ok(())
}

#[test]
fn path_to_name_numbers_in_path() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_path_to_name("Foo123/Bar456.pm"), "Foo123::Bar456");
    Ok(())
}

#[test]
fn path_to_name_underscores_in_path() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_path_to_name("foo_bar/baz_qux.pm"), "foo_bar::baz_qux");
    Ok(())
}

#[test]
fn path_to_name_hyphens_in_path() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_path_to_name("my-module/sub-module.pm"), "my-module::sub-module");
    Ok(())
}

#[test]
fn path_to_name_very_deep_path() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_path_to_name("A/B/C/D/E/F/G/H/I/J.pm"), "A::B::C::D::E::F::G::H::I::J");
    Ok(())
}

#[test]
fn path_to_name_single_segment_no_extension() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_path_to_name("Module"), "Module");
    Ok(())
}

#[test]
fn path_to_name_double_extension_pm_pl() -> Result<(), Box<dyn std::error::Error>> {
    // Only the last .pm or .pl is stripped
    assert_eq!(module_path_to_name("Foo.pm.pl"), "Foo.pm");
    Ok(())
}

#[test]
fn path_to_name_double_extension_pl_pm() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_path_to_name("Foo.pl.pm"), "Foo.pl");
    Ok(())
}

// ── file_path_to_module_name: Complex lib detection ──────────────────

#[test]
fn file_path_lib_in_middle_of_filename() -> Result<(), Box<dyn std::error::Error>> {
    // "lib" as part of a filename, not a directory boundary
    assert_eq!(file_path_to_module_name("/project/reliable.pm"), "reliable");
    Ok(())
}

#[test]
fn file_path_libing_as_segment() -> Result<(), Box<dyn std::error::Error>> {
    // "libing" or similar should not match /lib/
    assert_eq!(file_path_to_module_name("/project/libing/Module.pm"), "Module");
    Ok(())
}

#[test]
fn file_path_libfoo_directory() -> Result<(), Box<dyn std::error::Error>> {
    // /libfoo/ should not match /lib/
    assert_eq!(file_path_to_module_name("/project/libfoo/Module.pm"), "Module");
    Ok(())
}

#[test]
fn file_path_three_lib_segments_uses_last() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(file_path_to_module_name("/a/lib/b/lib/c/lib/Foo/Bar.pm"), "Foo::Bar");
    Ok(())
}

#[test]
fn file_path_lib_at_end() -> Result<(), Box<dyn std::error::Error>> {
    // /project/path/to/lib should not match the trailing /lib/ pattern without more segments
    assert_eq!(file_path_to_module_name("/project/path/to/lib/"), "");
    Ok(())
}

#[test]
fn file_path_windows_drive_with_lib() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(file_path_to_module_name(r"D:\project\lib\My\Module.pm"), "My::Module");
    Ok(())
}

#[test]
fn file_path_windows_drive_without_lib() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(file_path_to_module_name(r"D:\project\bin\script.pl"), "script");
    Ok(())
}

#[test]
fn file_path_unc_path_with_lib() -> Result<(), Box<dyn std::error::Error>> {
    // UNC paths like //server/share, converted to forward slashes
    assert_eq!(file_path_to_module_name(r"\\server\share\lib\Foo\Bar.pm"), "Foo::Bar");
    Ok(())
}

#[test]
fn file_path_lib_relative_path() -> Result<(), Box<dyn std::error::Error>> {
    // lib as the first segment
    assert_eq!(file_path_to_module_name("lib/Foo/Bar/Baz.pm"), "Foo::Bar::Baz");
    Ok(())
}

#[test]
fn file_path_absolute_with_multiple_dots_in_name() -> Result<(), Box<dyn std::error::Error>> {
    // Dots in the filename before extension
    assert_eq!(file_path_to_module_name("/project/lib/Foo.Bar.Baz.pm"), "Foo.Bar.Baz");
    Ok(())
}

#[test]
fn file_path_hidden_file_with_lib() -> Result<(), Box<dyn std::error::Error>> {
    // Hidden files (starting with .) in lib/ directory
    assert_eq!(file_path_to_module_name("/project/lib/.hidden.pm"), ".hidden");
    Ok(())
}

#[test]
fn file_path_deeply_nested_within_lib() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(file_path_to_module_name("/a/b/c/lib/d/e/f/g/h/Module.pm"), "d::e::f::g::h::Module");
    Ok(())
}

#[test]
fn file_path_relative_without_lib() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(file_path_to_module_name("src/Foo/Bar.pm"), "Bar");
    Ok(())
}

#[test]
fn file_path_relative_with_parent_refs() -> Result<(), Box<dyn std::error::Error>> {
    // .. in path
    assert_eq!(file_path_to_module_name("../lib/Foo/Bar.pm"), "Foo::Bar");
    Ok(())
}

#[test]
fn file_path_dot_segment() -> Result<(), Box<dyn std::error::Error>> {
    // . (current dir) segments in path
    assert_eq!(file_path_to_module_name("./lib/Foo/Bar.pm"), "Foo::Bar");
    Ok(())
}

// ── Round-trip and integration tests: Extended ───────────────────────

#[test]
fn round_trip_with_underscores() -> Result<(), Box<dyn std::error::Error>> {
    let original = "My_App::Service::Email_Handler";
    let path = module_name_to_path(original);
    assert_eq!(module_path_to_name(&path), original);
    Ok(())
}

#[test]
fn round_trip_with_numbers() -> Result<(), Box<dyn std::error::Error>> {
    let original = "Foo123::Bar456::Baz789";
    let path = module_name_to_path(original);
    assert_eq!(module_path_to_name(&path), original);
    Ok(())
}

#[test]
fn round_trip_very_deep() -> Result<(), Box<dyn std::error::Error>> {
    let original = "A::B::C::D::E::F::G::H::I::J::K::L::M::N::O::P";
    let path = module_name_to_path(original);
    assert_eq!(module_path_to_name(&path), original);
    Ok(())
}

#[test]
fn round_trip_single_segment() -> Result<(), Box<dyn std::error::Error>> {
    let original = "SoleModule";
    let path = module_name_to_path(original);
    assert_eq!(module_path_to_name(&path), original);
    Ok(())
}

#[test]
fn file_path_to_path_to_name_chain() -> Result<(), Box<dyn std::error::Error>> {
    let file = "/project/lib/My/Deep/Nested/Module.pm";
    let name = file_path_to_module_name(file);
    assert_eq!(name, "My::Deep::Nested::Module");
    let path = module_name_to_path(&name);
    assert_eq!(path, "My/Deep/Nested/Module.pm");
    let back_to_name = module_path_to_name(&path);
    assert_eq!(back_to_name, name);
    Ok(())
}

// ── Boundary and stress tests ───────────────────────────────────────

#[test]
fn name_to_path_max_segment_length() -> Result<(), Box<dyn std::error::Error>> {
    let long_segment = "A".repeat(256);
    let input = format!("{}::B", long_segment);
    let result = module_name_to_path(&input);
    assert!(result.contains(&format!("{}/B.pm", long_segment)));
    Ok(())
}

#[test]
fn path_to_name_max_path_length() -> Result<(), Box<dyn std::error::Error>> {
    let long_path = (0..100).map(|i| format!("Seg{}", i)).collect::<Vec<_>>().join("/");
    let input = format!("{}.pm", long_path);
    let result = module_path_to_name(&input);
    let expected = (0..100).map(|i| format!("Seg{}", i)).collect::<Vec<_>>().join("::");
    assert_eq!(result, expected);
    Ok(())
}

#[test]
fn file_path_to_module_max_depth() -> Result<(), Box<dyn std::error::Error>> {
    let mut path = String::from("/a/b/c/d/e/f/g/h/i/j/lib");
    for i in 0..50 {
        path.push_str(&format!("/Seg{}", i));
    }
    path.push_str(".pm");
    let result = file_path_to_module_name(&path);
    let mut expected = String::new();
    for i in 0..50 {
        if i > 0 {
            expected.push_str("::");
        }
        expected.push_str(&format!("Seg{}", i));
    }
    assert_eq!(result, expected);
    Ok(())
}

// ── Special character handling ──────────────────────────────────────

#[test]
fn normalize_unicode_package() -> Result<(), Box<dyn std::error::Error>> {
    let result = normalize_package_separator("Foo'Bär'Ñoño");
    assert_eq!(result, "Foo::Bär::Ñoño");
    Ok(())
}

#[test]
fn name_to_path_japanese_chars() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_name_to_path("日本語::モジュール"), "日本語/モジュール.pm");
    Ok(())
}

#[test]
fn path_to_name_emoji_in_segment() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_path_to_name("Foo🦀/Bar.pm"), "Foo🦀::Bar");
    Ok(())
}

#[test]
fn file_path_emoji_in_filename() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(file_path_to_module_name("/lib/Test🦀/Module.pm"), "Test🦀::Module");
    Ok(())
}

// ── Whitespace and control characters ───────────────────────────────

#[test]
fn name_to_path_spaces_preserved() -> Result<(), Box<dyn std::error::Error>> {
    // Spaces in module names are unusual but allowed; they're preserved
    assert_eq!(module_name_to_path("Foo Bar::Baz"), "Foo Bar/Baz.pm");
    Ok(())
}

#[test]
fn path_to_name_spaces_preserved() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_path_to_name("Foo Bar/Baz.pm"), "Foo Bar::Baz");
    Ok(())
}

#[test]
fn file_path_spaces_in_directory() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(file_path_to_module_name("/my project/lib/My Module/Class.pm"), "My Module::Class");
    Ok(())
}

#[test]
fn file_path_spaces_in_filename() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(file_path_to_module_name("/lib/My Class.pm"), "My Class");
    Ok(())
}

// ── Multiple transformations and conversions ────────────────────────

#[test]
fn name_to_path_to_name_with_legacy_sep() -> Result<(), Box<dyn std::error::Error>> {
    let original = "Foo'Bar'Baz";
    let path = module_name_to_path(original);
    let back = module_path_to_name(&path);
    // Legacy separator gets normalized
    assert_eq!(back, "Foo::Bar::Baz");
    Ok(())
}

#[test]
fn file_path_lib_stripping_then_path_conversion() -> Result<(), Box<dyn std::error::Error>> {
    let file = "/workspace/lib/Deep/Nested/Module.pm";
    let name = file_path_to_module_name(file);
    assert_eq!(name, "Deep::Nested::Module");
    let back_to_path = module_name_to_path(&name);
    assert_eq!(back_to_path, "Deep/Nested/Module.pm");
    Ok(())
}

#[test]
fn module_path_to_name_strips_lib_prefix_via_file_path() -> Result<(), Box<dyn std::error::Error>> {
    // file_path_to_module_name strips lib/, but module_path_to_name does not
    let file_input = "/project/lib/Foo/Bar.pm";
    let file_result = file_path_to_module_name(file_input);
    assert_eq!(file_result, "Foo::Bar");

    let path_input = "lib/Foo/Bar.pm";
    let path_result = module_path_to_name(path_input);
    assert_eq!(path_result, "lib::Foo::Bar");
    Ok(())
}

// ── Empty and minimal inputs ────────────────────────────────────────

#[test]
fn path_to_name_only_dot_pm() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_path_to_name(".pm"), "");
    Ok(())
}

#[test]
fn path_to_name_only_dot_pl() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_path_to_name(".pl"), "");
    Ok(())
}

#[test]
fn path_to_name_slash_only() -> Result<(), Box<dyn std::error::Error>> {
    // Single slash creates two segments: "" and "" which become one colon pair
    assert_eq!(module_path_to_name("/"), "::");
    Ok(())
}

#[test]
fn file_path_only_dot() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(file_path_to_module_name("."), ".");
    Ok(())
}

#[test]
fn file_path_only_two_dots() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(file_path_to_module_name(".."), "..");
    Ok(())
}

#[test]
fn normalize_just_colon_pair() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(normalize_package_separator("::"), "::");
    Ok(())
}

// ── Case sensitivity tests ─────────────────────────────────────────

#[test]
fn name_to_path_mixed_case_preserved() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(
        module_name_to_path("MyModule::anotherModule::ALLCAPS"),
        "MyModule/anotherModule/ALLCAPS.pm"
    );
    Ok(())
}

#[test]
fn path_to_name_case_preserved() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(
        module_path_to_name("MyModule/anotherModule/ALLCAPS.pm"),
        "MyModule::anotherModule::ALLCAPS"
    );
    Ok(())
}

#[test]
fn file_path_case_preserved_with_lib() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(
        file_path_to_module_name("/Project/lib/MyModule/AnotherModule.pm"),
        "MyModule::AnotherModule"
    );
    Ok(())
}

// ── Repetition and redundancy tests ────────────────────────────────

#[test]
fn name_to_path_repeated_segments() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_name_to_path("Foo::Foo::Foo"), "Foo/Foo/Foo.pm");
    Ok(())
}

#[test]
fn path_to_name_repeated_segments() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(module_path_to_name("Foo/Foo/Foo.pm"), "Foo::Foo::Foo");
    Ok(())
}

#[test]
fn file_path_repeated_lib_segments_uses_last() -> Result<(), Box<dyn std::error::Error>> {
    assert_eq!(file_path_to_module_name("/lib/foo/lib/bar/lib/Module.pm"), "Module");
    Ok(())
}