% Testing

There is a new edition of the book and this is an old link.

> Rust includes support for writing software tests within the language itself.

```rust
#[cfg(test)]
mod tests {
    #[test]
    fn it_works() {
    }
}
```

---

Here are the relevant sections in the new and old books:

* **[In the second edition: Ch 11.00 — Testing][2]**
* [In the first edition: Ch 4.2 — Testing][1]

[1]: first-edition/testing.html
[2]: second-edition/ch11-00-testing.html
