Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zipper tests fail on Windows #75

Closed
cxcorp opened this issue Dec 16, 2016 · 1 comment
Closed

Zipper tests fail on Windows #75

cxcorp opened this issue Dec 16, 2016 · 1 comment

Comments

@cxcorp
Copy link
Contributor

cxcorp commented Dec 16, 2016

On Windows, zipperDetectectsAndObeysTmcnosubmitFiles and zipperCorrectlyZipsFolderWithFilesAndSubFolders from fi.helsinki.cs.tmc.langs.io.zip.StudentFileAwareZipperTest fail because some of the zip entry names have their forward slashes turned into backslashes. For example, tmcnosubmit_test_case/allowed/ gets changed into tmcnosubmit_test_case\allowed/.

Honestly though, I don't quite understand why the zip files' entries are checked via a hashmap .Contains(filename)-kind of check. Wouldn't ZipFile.equals work?

@cxcorp
Copy link
Contributor Author

cxcorp commented Dec 16, 2016

Probable culprit: https://github.com/testmycode/tmc-langs/blob/master/tmc-langs-framework/src/main/java/fi/helsinki/cs/tmc/langs/io/zip/StudentFileAwareZipper.java#L112

    String name = projectPath.getParent().relativize(currentPath).toString();
    
    if (Files.isDirectory(currentPath)) {
        log.trace("{} is a directory", currentPath);
        // Must be "/", can not be replaces with File.separator
        name += "/";
    }

I'm guessing Path.toString outputs platform-specific slashes.

cxcorp added a commit to cxcorp/tmc-langs that referenced this issue Dec 22, 2016
cxcorp added a commit to cxcorp/tmc-langs that referenced this issue Dec 22, 2016
cxcorp added a commit to cxcorp/tmc-langs that referenced this issue Jan 3, 2017
cxcorp added a commit to cxcorp/tmc-langs that referenced this issue Jan 3, 2017
cxcorp added a commit to cxcorp/tmc-langs that referenced this issue Jan 3, 2017
cxcorp added a commit to cxcorp/tmc-langs that referenced this issue Jan 3, 2017
cxcorp added a commit to cxcorp/tmc-langs that referenced this issue Jan 3, 2017
cxcorp added a commit to cxcorp/tmc-langs that referenced this issue Jan 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant