O'Reilly logo

Mastering Rust by Vesa Kaihlavirta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Unit Testing and Benchmarking

In this chapter, we will talk about the different methods of writing tests and benchmarks in Rust. Then, we'll put those skills to use and implement a few basic things in our project in a TDD style.

In this chapter, we will cover the following topics:

  • Motivation for unit testing
  • Test annotations
  • Assert macros
  • Integration tests
  • Documentation tests
  • Doing TDD with our project

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required