There too many super keywords for function tests

I use such construction in normal "executable crate" case:

mod a;
mod b;
fn main() {}
pub fn a_f() {}
use super::a;

pub fn b() {

but if I try to use the same code for functional test:


then cargo+rustc tells me:

error[E0433]: failed to resolve: there are too many leading `super` keywords
 --> tests/
1 | use super::a;
  |     ^^^^^ there are too many leading `super` keywords

why and how can I fix this?

Each .rs file directly in the tests directory is considered an independant module.

If you want to structure your integration tests in modules you have to put them in a subdirectory.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.