Skip to content

Conversation

@sogaiu
Copy link
Contributor

@sogaiu sogaiu commented Jun 28, 2025

@borkdude
Copy link
Contributor

FAIL in (zip-unzip-test) (fs_test.clj:680)
Use extract-fn and :entry key
expected: (not (fs/exists? (fs/file td-out2 "src" "babashka" "fs.cljc")))
  actual: (not (not true))

@sogaiu
Copy link
Contributor Author

sogaiu commented Jun 28, 2025

Thanks!

I guess it wasn't as unlikely as I thought 😅

      ;; unlikely that fs.cljc would have the same last modified time
      (is (not (fs/exists? (fs/file td-out2 "src" "babashka" "fs.cljc"))))

@sogaiu
Copy link
Contributor Author

sogaiu commented Jun 28, 2025

I changed the failing test so that during the initial extraction to out1, the times for extracted files are all remembered. If there is only one remembered time, it means that both README.md and fs.cljc had the same time, otherwise they had different times.

After the second extraction to out2 occurs for files that have the same times as README.md, if the number of remembered times is 1, then both README.md and fs.cljc should have been extracted. Otherwise, only README.md should have been extracted.

Hmm, this seems a bit fragile because it depends on there only being one file somewhere under src. I will change the test so that two specific files are involved instead. I think that will be more robust in case more files show up under src in the future.

@sogaiu
Copy link
Contributor Author

sogaiu commented Jun 28, 2025

I chose to use the files LICENSE and README.md thinking that they would likely be in place for some time.

@borkdude borkdude merged commit 74a8d94 into babashka:master Jun 28, 2025
7 checks passed
@borkdude
Copy link
Contributor

Excellent first contribution to babashka/fs, thank you @sogaiu!

@sogaiu
Copy link
Contributor Author

sogaiu commented Jun 29, 2025

Thanks for babashka/fs and all of your other work!

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

Successfully merging this pull request may close these issues.

2 participants