How to Test Asynchronous Rust Programs with Tokio [TUTORIAL]

preview_player
Показать описание
Learn how to test your asynchronous and multi-threaded programs in Rust using the Tokio runtime! This comprehensive tutorial covers:

- The tokio test attribute
- Using tokio test macros
- Tokio assertion macros (assert_pending macro, assert_ready macro, assert_ready_ok macro, assert_ready_err, assert_ready_eq macro)
- Testing timeouts / intervals efficiently

Chapters:
00:00 The Problem
01:03 The Tokio Test Macro
04:13 Tokio Assertion Macros
08:15 Bonus (Working with Timeouts/Intervals)

Perfect for Rust developers looking to level up their async testing skills. Includes practical examples and common pitfalls to avoid.

#RustLang #Programming #TokioRust #CodingTutorial #AsyncProgramming #RustProgramming #SoftwareDevelopment
Рекомендации по теме
Комментарии
Автор

The start_paused was a really neat trick I would have likeky not found out about. Thanks

antoniong
Автор

Excellent video.

I wanted to clarify one thing on your analogy between JS promises and Rust futures. One key difference here is that a Rust future will never execute anything until you await it. Whereas a JS promise will begin execution when it’s initialized. In other words, Rust futures are lazy and JS promises are eager.

jjferman
Автор

What a great consise video. Thanks I love this.

thefluentone
Автор

your neovim looks so polished, do you have it on github?

giorgos-
welcome to shbcf.ru