Last active
August 29, 2015 13:56
-
-
Save jvmvik/9261528 to your computer and use it in GitHub Desktop.
here a bug found in JDK 7.45 on Windows. I'm running Groovy 2.2.1 on the top of the JVM.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Test | |
import java.nio.file.FileVisitResult | |
import java.nio.file.Path | |
import java.nio.file.Paths | |
/*** | |
* Bug with directory starting by '.' | |
* | |
* Here is test to reproduce this issue. | |
* - Windows 7 / 64 bits | |
* - JVM 7.45 | |
*/ | |
class JavaBug | |
{ | |
@Test | |
void fileWithDot() | |
{ | |
Path path = Paths.get("path/to/.git"); | |
// This test should fail because the directory name is: .git | |
assert !path.fileName.startsWith("."); | |
// This test passed when the directory name is converted to String | |
assert path.fileName.toString().startsWith("."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment