blob: a631f7f8bb367668d7a1707d37b664673559a78c (
plain)
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
|
package org.zwobble.mammoth.tests.docx;
import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.zwobble.mammoth.internal.docx.Uris.uriToZipEntryName;
public class Uris {
@Test
public void whenPathDoesNotHaveLeadingSlashThenPathIsResolvedRelativeToBase() {
assertThat(
uriToZipEntryName("one/two", "three/four"),
equalTo("one/two/three/four")
);
}
@Test
public void whenPathHasLeadingSlashThenBaseIsIgnored() {
assertThat(
uriToZipEntryName("one/two", "/three/four"),
equalTo("three/four")
);
}
}
|