Skip to content

Commit f7864f6

Browse files
committed
Add test.
1 parent b3fb503 commit f7864f6

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

box/src/main/java/ch/cyberduck/core/box/BoxTouchFeature.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ public boolean isSupported(final Path workdir, final String name) {
3333
if(StringUtils.length(name) > 255) {
3434
return false;
3535
}
36-
// Names containing non-printable ASCII characters, forward and backward slashes (/, \), as well as names with trailing spaces are prohibited.
37-
if(!StringUtils.isAsciiPrintable(name)) {
38-
return false;
39-
}
4036
if(StringUtils.contains(name, "/")) {
4137
return false;
4238
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package ch.cyberduck.core.box;
2+
3+
/*
4+
* Copyright (c) 2002-2023 iterate GmbH. All rights reserved.
5+
* https://cyberduck.io/
6+
*
7+
* This program is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*/
17+
18+
import ch.cyberduck.core.features.Home;
19+
import ch.cyberduck.test.IntegrationTest;
20+
21+
import org.junit.Test;
22+
import org.junit.experimental.categories.Category;
23+
24+
import static org.junit.Assert.assertTrue;
25+
26+
@Category(IntegrationTest.class)
27+
public class BoxTouchFeatureTest extends AbstractBoxTest {
28+
29+
@Test
30+
public void testSupported() {
31+
final BoxFileidProvider fileid = new BoxFileidProvider(session);
32+
assertTrue(new BoxTouchFeature(session, fileid).isSupported(Home.ROOT, "xacjivli-éf"));
33+
}
34+
}

0 commit comments

Comments
 (0)