Skip to content

Commit

Permalink
Add test cases to url naming
Browse files Browse the repository at this point in the history
  • Loading branch information
tdrwenski committed Jun 12, 2024
1 parent 378806e commit 27422a6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cdm/core/src/test/java/ucar/nc2/util/TestURLnaming.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

package ucar.nc2.util;

import static com.google.common.truth.Truth.assertThat;

import java.lang.invoke.MethodHandles;
import org.junit.Test;
import org.slf4j.Logger;
Expand All @@ -30,6 +32,14 @@ public void testResolve() {
testResolve("file://test/me/", "file:/wanna", "file:/wanna");
testResolve("file://test/me/", "C:/wanna", "C:/wanna");
testResolve("http://test/me/", "file:wanna", "file:wanna");

testResolve("urlWithoutSlash", "file:///path/with/slash", "file:///path/with/slash");
}

@Test
public void testResolveFile() {
assertThat(URLnaming.resolveFile("urlWithoutSlash", "file:///path/with/slash"))
.isEqualTo("file:///path/with/slash");
}

private void testResolve(String base, String rel, String result) {
Expand Down

0 comments on commit 27422a6

Please sign in to comment.