use of org.eclipse.xtend.lib.macro.file.Path in project xtext-xtend by eclipse.
the class PathTest method testRelativize.
@Test
public void testRelativize() {
Path _path = new Path("foo");
Assert.assertEquals(_path, new Path("/hubba/bubba/foo").relativize("/hubba/bubba"));
Path _path_1 = new Path("foo");
Assert.assertEquals(_path_1, new Path("hubba/bubba/foo").relativize("hubba/bubba"));
try {
new Path("hubba/bubba/foo").relativize("/hubba/bubba");
} catch (final Throwable _t) {
if (_t instanceof IllegalArgumentException) {
} else {
throw Exceptions.sneakyThrow(_t);
}
}
try {
new Path("/hubba/bubba/foo").relativize("hubba/bubba");
} catch (final Throwable _t_1) {
if (_t_1 instanceof IllegalArgumentException) {
} else {
throw Exceptions.sneakyThrow(_t_1);
}
}
Assert.assertNull(new Path("/foo").relativize("/bar"));
}
use of org.eclipse.xtend.lib.macro.file.Path in project xtext-xtend by eclipse.
the class PathTest method testPathStartsWith.
@Test
public void testPathStartsWith() {
Path _path = new Path("/foo/bar/baz.txt");
Path _path_1 = new Path("/");
Assert.assertTrue(_path.startsWith(_path_1));
Path _path_2 = new Path("/foo/bar/baz.txt");
Path _path_3 = new Path("/foo");
Assert.assertTrue(_path_2.startsWith(_path_3));
Path _path_4 = new Path("/foo/bar/baz.txt");
Path _path_5 = new Path("/foo/bar");
Assert.assertTrue(_path_4.startsWith(_path_5));
Path _path_6 = new Path("/foo/bar/baz.txt");
Path _path_7 = new Path("/foo/bar/baz.txt");
Assert.assertTrue(_path_6.startsWith(_path_7));
Path _path_8 = new Path("/foo/bar/baz.txt");
Path _path_9 = new Path("foo");
Assert.assertFalse(_path_8.startsWith(_path_9));
Path _path_10 = new Path("/foo/bar/baz.txt");
Path _path_11 = new Path("foo/bar/baz.txt");
Assert.assertFalse(_path_10.startsWith(_path_11));
Path _path_12 = new Path("/foo/bar/baz.txt");
Path _path_13 = new Path("/foo/bar/baz");
Assert.assertFalse(_path_12.startsWith(_path_13));
}
Aggregations