If I have this function in src/test.rs
pub fn print_something(){
println!("Something");
}
how can I call it in the example/test.rs ?
I've tried with extern crate, mod, use but none of these worked.
First, you have to declare the test module in src/lib.rs:
pub mod test;
Then, inside examples/test.rs, just use it as a library:
crate_name::test::print_something(); // Replace `crate_name` by the crate name
crate:: and that didn't work.crate can be used only when trying to refer to modules within the same crate.