I am a beginner and I'm currently in Chapter 12.4. There is this suggestion there:
Feel free to write some tests for the functionality in the
Config::new
andrun
functions on your own.
I am wondering what tests one can write for the run function in the project? The run function doesn't return anything except an error if something goes wrong. Can someone suggest what sort of test I could write here? For reference here is what the run function looks like in my lib.rs (same as in the book):
fn run(config: Config) -> Result<(), Box<dyn Error>> {
let contents = fs::read_to_string(config.filename)?;
println!("With text:\n{}", contents);
Ok(())
}