summaryrefslogtreecommitdiffstats
path: root/src/doc/book/redirects/testing.md
blob: f2030654fd9118cc66300a6787b84d135aaa262f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
% Testing

<small>There is a new edition of the book and this is an old link.</small>

> 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 current edition: Ch 11.00 — Testing][2]**
* <small>[In the first edition: Ch 4.2 — Testing][1]</small>


[1]: https://doc.rust-lang.org/1.30.0/book/first-edition/testing.html
[2]: ch11-00-testing.html