File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -332,7 +332,7 @@ let test_relocate4 =
332332
333333let test_relocate5 =
334334 let open Alcotest in
335- test_case " relocate when common suffixes 1" `Quick (fun () ->
335+ test_case " relocate when common prefixes 1" `Quick (fun () ->
336336 let open Yocaml.Path in
337337 let expected = rel [ " foo" ; " bar" ; " index.html" ]
338338 and computed =
@@ -344,7 +344,7 @@ let test_relocate5 =
344344
345345let test_relocate6 =
346346 let open Alcotest in
347- test_case " relocate when common suffixes 2" `Quick (fun () ->
347+ test_case " relocate when common prefixes 2" `Quick (fun () ->
348348 let open Yocaml.Path in
349349 let expected = rel [ " foo" ; " bar" ; " baz" ; " index.html" ]
350350 and computed =
@@ -354,6 +354,18 @@ let test_relocate6 =
354354 in
355355 check Testable. path " should be equal" expected computed)
356356
357+ let test_relocate7 =
358+ let open Alcotest in
359+ test_case " relocate when partial common prefixes" `Quick (fun () ->
360+ let open Yocaml.Path in
361+ let expected = rel [ " foo" ; " bar" ; " foo" ; " baz" ; " index.html" ]
362+ and computed =
363+ relocate
364+ ~into: (rel [ " foo" ; " bar" ])
365+ (rel [ " foo" ; " baz" ; " index.html" ])
366+ in
367+ check Testable. path " should be equal" expected computed)
368+
357369let test_from_string1 =
358370 let open Alcotest in
359371 test_case " from_string 1" `Quick (fun () ->
@@ -435,6 +447,7 @@ let cases =
435447 ; test_relocate4
436448 ; test_relocate5
437449 ; test_relocate6
450+ ; test_relocate7
438451 ; test_from_string1
439452 ; test_from_string2
440453 ; test_from_string3
You can’t perform that action at this time.
0 commit comments