4 ms·
Yeah the resources feature in Java https://www.jetbrains.com/help/idea/resource-files.html https://www.jetbrains.com/help/idea/resource-files.html makes it ea
by xmcqdpt2 4y ago
Yeah the resources feature in Java
https://www.jetbrains.com/help/idea/resource-files.html https://www.jetbrains.com/help/idea/resource-files.html
makes it easy to embed arbitrary data with your code (or in this case, your tests, which are usually compiled separately) so no, you can easily test against files without access to a filesystem (beyond the access required to read the jars).
I still think having test cases with strings in the code is often a lot clearer personally.
(Unrelated: I wish more PLs made it easy to embed files within executables and access them with an OS-independent filesystem like API, it's often very useful.)