1
0
mirror of https://github.com/etesync/android synced 2024-12-04 13:58:52 +00:00
etesync-android/app/src/test/java/at/bitfire/davdroid/TestDavUtils.java
Ricki Hirner 28e567cf78 Introduce local unit tests
* split tests into Android tests and local unit tests
* LoginCredentialsFragment: check for empty host before doing IDN conversion
2016-04-26 13:10:42 +02:00

27 lines
891 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* 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.Assert;
import org.junit.Test;
public class TestDavUtils {
private static final String exampleURL = "http://example.com/";
@Test
public void testLastSegmentOfUrl() {
Assert.assertEquals("/", DavUtils.lastSegmentOfUrl(exampleURL));
Assert.assertEquals("dir", DavUtils.lastSegmentOfUrl(exampleURL + "dir"));
Assert.assertEquals("dir", DavUtils.lastSegmentOfUrl(exampleURL + "dir/"));
Assert.assertEquals("file.html", DavUtils.lastSegmentOfUrl(exampleURL + "dir/file.html"));
}
}