quick introduction, I came from python I have studied it by myself, and now I'm trying to learn Rust. I find it a bit confusing.
I have a main.rs
file and other .rs
files in the src
directory just to have cleaner and organized code, as each of these other files do specific tasks and the main.rs
just put all together with a simple CLI.
I just wanna test a single of these .rs
file, or even a single fn
inside to check if the result is what I am expecting.
How can I do that? It's simple, it's stupid, but I have read around and found nothing that could help me in the end.
I read this, where it talks about making a tests
folder and then using cargo test
, I've done it, but it still runs the src/main.rs
instead of what I have put in tests
. BTW I'm using CLion with the Rust plugin.
Sorry if this is somewhat a duplicate, I looked around but I didn't found an answer.