Comments (3)
Thanks very much for the clear report and reproduction! I had not realized that you could have mod statements that correspond to multiple directories but it makes sense.
I think visit_item_mod
should already be tracking the nested namespaces.
Lines 341 to 356 in 4424126
The problem is that the accumulated list of external_mods
only takes the last component of the path. Maybe it should use the whole stack... although, we need to probably be careful to get this right if the mod we're already looking at is some layers down.
The interaction of the stack with the existing filenames suggests to me that maybe a better test is something with a mix of a file that is itself 2 levels down, and that then has an external mod that is then some further levels down.
A PR would be very welcome.
Some ideas on how to start:
- Copy your tree under testdata with an appropriate directory and package name
- Add it to the workspace exclusions in
/Cargo.toml
- Add the namespaces to the stack in
visit.rs
- Add a test in
visit.rs
for reading the testdata, like inLines 589 to 599 in 4424126
from cargo-mutants.
Also, not necessarily in the same PR: at the moment
Lines 65 to 74 in 4424126
Lines 457 to 468 in 4424126
from cargo-mutants.
Thanks, I merged that PR, but I suspect there is some more to do here because inline mod
statements can have a path
attribute that controls which directory they should read: https://doc.rust-lang.org/reference/items/modules.html#the-path-attribute
This will still fix some trees and I'll file a separate issue for that.
from cargo-mutants.
Related Issues (20)
- Support #[mutants::skip] attribute on more statements
- `.ignore` files can exclude files that should be copied HOT 7
- Mutating const functions can cause the build to hang HOT 10
- Document `--timeout-multiplier` HOT 2
- Delete fields from struct literals that have a base (default) expression
- Separate finding modules from generating mutants?
- Write one consolidated output json
- Clean warning and success if the `--in-diff` diff file is empty?
- panic at `src/lab.rs:134:26` when interrupted
- 'impl trait' representation in mutant names can be wrong vs Rust source
- Follow `path` attribute on inline `mod` blocks HOT 5
- CI job that tests against some interesting/popular open source trees
- Try using a build profile that is quick but has no debug symbols
- More detail in CONTRIBUTING.md or the book about how to add new patterns
- Automatically merge results from multiple sharded jobs
- Test that requires copying `.git` HOT 3
- Support more cargo test flags HOT 2
- cargo-mutants doesn't work on tarpaulin tree HOT 1
- Check up on Debian packaging
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cargo-mutants.