Unable to test a binary project

My file structure is the following:

src/
    bin/
        testing/
            mod.rs
        main.rs
    lib.rs
tests/
    test.rs

I'm looking to test a function in testing/mod.rs in tests/test.rs, so I can use cargo test.

As it stands, cargo test, and cargo run work independently. How can I test that function?

Untested: declare the module in the testfile, mod bin { mod testing }}.

Alternatively make it available through the lib or write unit tests in the module.

Try crate assert_cli.

May help: