Commit 440dcc52 authored by Geoffrey Métais's avatar Geoffrey Métais

@test markup, and remove impossible test

TextUtils class is part of Android framework and mocking is not ready
parent e05a8f5f
package org.videolan.vlc.util;
import org.junit.Test;
import static org.junit.Assert.*;
public class StringsTest {
@Test
public void testGetName(){
String path = "/home/folder/file.txt";
assertEquals("", Strings.getName(null));
......@@ -12,23 +14,26 @@ public class StringsTest {
assertEquals("file.txt", Strings.getName(path));
}
public void testGetParent() {
String result = Strings.getParent("");
assertEquals("", result);
result = Strings.getParent("/");
assertEquals("/", result);
result = Strings.getParent("/folder");
assertEquals("/", result);
//TextUtils mock is not ready :/
// @Test
// public void testGetParent() {
// String result = Strings.getParent("");
// assertEquals("", result);
//
// result = Strings.getParent("/");
// assertEquals("/", result);
//
// result = Strings.getParent("/folder");
// assertEquals("/", result);
//
// result = Strings.getParent("/folder/");
// assertEquals("/", result);
//
// result = Strings.getParent("/folder/sub");
// assertEquals("/folder", result);
//
// result = Strings.getParent("/folder/sub/");
// assertEquals("/folder", result);
// }
result = Strings.getParent("/folder/");
assertEquals("/", result);
result = Strings.getParent("/folder/sub");
assertEquals("/folder", result);
result = Strings.getParent("/folder/sub/");
assertEquals("/folder", result);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment