Closed phantamanta44 closed 5 years ago
Nice catch! And thanks for the PR. If you got the time, could you please add a unit test case also for this? In MockedTestCases.java for example.
Some example code to get you started. Note: I haven't tried this or compiled.
@Test
public void testListMultibyte() throws Exception {
server.add("serial-123");
server.expectList("serial-123", "/remote/path").withContent(new String[]{"normal.file", "multibyte example here please :-).extension"});
JadbDevice device = connection.getDevices().get(0);
List<RemoteFile> files = device.list("/remote/path");
// TODO: Assert files contains correct file names
}
Note: expectList is not implemented (or I didn't find it). Implementing it is the main thing to do here. Once you have expectList the actual unit test is trivial.
turns out there were no existing facilities whatsoever for testing file listing, so i just implemented all of that as well as the unicode thing
tested on my LG V35
At the moment,
JadbDevice#list
fails if the dir name contains multi-byte characters (for example, chinese characters) because it makes the assumption that each character is only one byte