You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
etesync-android/app/src/test/java/at/bitfire/davdroid/TestDavUtils.java

28 lines
884 B

8 years ago
/*
* Copyright © 2013 2016 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*/
package at.bitfire.davdroid;
import org.junit.Test;
8 years ago
8 years ago
import static org.junit.Assert.assertEquals;
public class TestDavUtils {
8 years ago
private static final String exampleURL = "http://example.com/";
@Test
8 years ago
public void testLastSegmentOfUrl() {
8 years ago
assertEquals("/", DavUtils.lastSegmentOfUrl(exampleURL));
assertEquals("dir", DavUtils.lastSegmentOfUrl(exampleURL + "dir"));
assertEquals("dir", DavUtils.lastSegmentOfUrl(exampleURL + "dir/"));
assertEquals("file.html", DavUtils.lastSegmentOfUrl(exampleURL + "dir/file.html"));
8 years ago
}
}