Skip to content

Commit 9dd46f2

Browse files
committed
Illustrate the issue with test_relocate7
1 parent 1b4ec48 commit 9dd46f2

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

test/yocaml/path_test.ml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ let test_relocate4 =
332332

333333
let 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

345345
let 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+
357369
let 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

0 commit comments

Comments
 (0)