<span class="filename">Filename: src/lib.rs</span>
+<!-- manual-regeneration
+cd listings/ch11-writing-automated-tests
+rm -rf listing-11-01
+cargo new --lib listing-11-01 --name adder
+cd listing-11-01
+cargo test
+git co output.txt
+cd ../../..
+-->
+
```rust,noplayground
{{#rustdoc_include ../listings/ch11-writing-automated-tests/listing-11-01/src/lib.rs}}
```
tests that should fail if any operation within them returns an `Err` variant.
You can’t use the `#[should_panic]` annotation on tests that use `Result<T,
-E>`. Instead, you should return an `Err` value directly when the test should
-fail.
+E>`. To assert that an operation returns an `Err` variant, *don’t* use the
+question mark operator on the `Result<T, E>` value. Instead, use
+`assert!(value.is_err())`.
Now that you know several ways to write tests, let’s look at what is happening
when we run our tests and explore the different options we can use with `cargo