Rust ๅ•ๅ…ƒๆต‹่ฏ•ๅพ—็Ÿฅ้“็š„ไธ€ๅˆ‡

ๆฅ่‡ช: Everything You Wanted to Know About Rust Unit Testing (and then some more) - YouTube

logging

Learn how to write unit tests in Rust with this hands-on video that covers these five topics with examples and real code:

  • The basic types of unit tests
  • The quality of the testing code
  • Testing the not-so-happy-path
  • Testing asynchronous code
  • Testing tools

โฑ๏ธ Timestamps โฑ๏ธ

00:00:00 - Intro

00:01:25 - Basic concepts

00:04:43 - Project creation

00:08:38 - Tests module

00:10:24 - Rust snippets for tests

00:14:21 - First unit test return value

00:24:03 - Second unit test state

00:28:46 - Alternative implementation tested

00:32:44 - Third unit test interaction

00:49:09 - Test code quality

00:49:34 - Use constants for literals

00:54:18 - Reduce repetition with setup and teardown

01:08:57 - Share code among test modules

01:13:05 - Why testing the not so happy path

01:13:32 - Test panics

01:18:03 - Use ignore and test results

01:28:02 - Bubble up errors in tests

01:30:34 - Asynchronous code in Rust

01:31:01 - Async tests

01:38:19 - Beyond cargo test

01:38:46 - rustdoc and doc-tests

01:48:00 - Show test output

01:49:33 - Selecting tests

01:55:55 - Test coverage

02:01:08 - Nextest

02:05:54 - Outro

refer.

ๅ…ณ้”ฎๅ‚่€ƒ

mongodb-developer/unit-testing-rust: This repository contains the code used in MongoDB's video "Intro to Unit Testing in Rust."

            _~`&โˆฝ~_
        () /  o โ†’  \ \/
          '_   โ–ณ   _'
          > '--#--' /

...act by ferris-actor v0.2.4 (built on 23.0303.201916)

็Ÿฅ่ฏ†ๅ…ฑไบซ่ฎธๅฏๅ่ฎฎ ๆœฌไฝœๅ“้‡‡็”จ็Ÿฅ่ฏ†ๅ…ฑไบซ็ฝฒๅ-็›ธๅŒๆ–นๅผๅ…ฑไบซ 4.0 ๅ›ฝ้™…่ฎธๅฏๅ่ฎฎ่ฟ›่กŒ่ฎธๅฏ;-)