topic: testing
rust has first-class test support built into cargo.
concepts to demonstrate
#[test] attribute
assert!, assert_eq!, assert_ne!
#[should_panic] for expected failures
#[cfg(test)] module pattern
- integration tests in
tests/ directory
- doc tests in
/// comments
patriots theme
unit tests for passer_rating() against brady's known 2004 stats.
integration test loading real CSV data from datasets/ and asserting totals.
files
src/testing/test_helpers.rs
tests/integration_stats.rs
reference
python mirror: basic_test_calculator.py, basic_test_hello.py
topic: testing
rust has first-class test support built into cargo.
concepts to demonstrate
#[test]attributeassert!,assert_eq!,assert_ne!#[should_panic]for expected failures#[cfg(test)]module patterntests/directory///commentspatriots theme
unit tests for
passer_rating()against brady's known 2004 stats.integration test loading real CSV data from
datasets/and asserting totals.files
src/testing/test_helpers.rstests/integration_stats.rsreference
python mirror:
basic_test_calculator.py,basic_test_hello.py