Closed msooseth closed 7 months ago
I think this is good. Also, getCurrentDirectory
returns absolute path but --root
can be relative so it might be better to use makeAbsolute in getRoot
so it always returns absolute path:
getRoot cmd = maybe getCurrentDirectory makeAbsolute (cmd.root)
I think this is good. Also,
getCurrentDirectory
returns absolute path but--root
can be relative so it might be better to use makeAbsolute ingetRoot
so it always returns absolute path:getRoot cmd = maybe getCurrentDirectory makeAbsolute (cmd.root)
That's a really good point, thanks! I was actually confused when I was debugging what that relative path was that it was referring to. It would have been a lot easier to understand the bug with this already there. I added it in. I'll wait for the checks to finish and then merge it in :)
Description
The
--root
option for thetest
subcommand didn't work actually. This is because wecwd
-d into the directory, then called all the functions with the directory name as a prefix, so the directory was in a sense prefixed twice. This is easy to test -- create atmp
subdirectory andcd
into it, callgit init
, callforge init --force
, add a solidity file undersrc/
runforge build
then go back withcd ..
and then runhevm test --root "tmp/"
it will fail.With this change, it now succeeds, as expected.
Checklist