I have a submodule for tests with the following structure. When I run cargo test I get an error:
file not found for module test_chunk
can someone explain this? I looked into the rust book but didnt find my error.
bytecode_interpreter
--Cargo.lock
--Cargo.toml
--src/
----common.rs
----main.rs
----tests.rs
----lib.rs
----tests/
------test_chunk
----target
then I have separated the test file into a subdirectory like done in the rust book:
//lib.rs
mod common;
#[cfg(test)]
mod tests;
//tests.rs
mod test_chunk;
//test_chunk.rs
use common;
#[test]
fn test_write_chunk() {
let chunk = CodeChunk::new();
chunk.write_chunk(chunk,common::OpCode::OpConstant, 0);
asserteq!(chunk.code[0] == common::OpCode::Halt)
}