Add test to gatherSources()
Closed this issue · 1 comments
squadack commented
gatherSources() is supposed to return list of files containing their contents and a path names under which this file will be looked for by solc. This means that for ceratin imports absolute path to the file is not the name we want. E.g.:
given filesystem:
'/home/path/contr.sol': 'import "package/smth.sol";',
'/home/node_modules/package/smth.sol': 'import "./other.sol";',
'/home/node_modules/package/other.sol': 'nothing'
when we start compilation from '/home/path/contr.sol' then solc will be looking for files "package/smth.sol" and "package/other.sol" (due to being resolved via relative path from file named "package/smth.sol" - doesn't start with '.' so solc treats it as absolute path). We need to add some code testing for that.
- add some tests without absolute paths
- add test that includes imports from URL (due to current usage of path module this should fail)
- add test with multiple starting points
//more to come?