Aditya Gupta

Integration Testing in Rust

Integration testing in Rust involves placing test files in a dedicated tests/ directory outside your main code. These tests interact with your library or binary the way an external user would, and they are compiled as separate crates, giving you full isolation for end-to-end behaviour validation. After getting comfortable with unit testing, I needed a

Integration Testing in Rust Read More »

Writing Unit Tests in Rust

Rust has built-in support for writing unit tests using the #[test] attribute. You can write test functions inside a special tests module, use assertion macros like assert_eq!, and run your tests with cargo test. Testing is part of the standard development flow in Rust, not an afterthought. When I started writing Rust seriously, I was

Writing Unit Tests in Rust Read More »

Advanced Collections: HashSet and BTreeMap in Rust

Rust provides powerful built-in collections like HashSet and BTreeMap for managing unique items and sorted key-value pairs. These types are part of the std::collections module and are commonly used in real-world Rust applications where performance, uniqueness, and order matter. After learning the basic collections like Vec and HashMap, I wanted to explore more specialized tools.

Advanced Collections: HashSet and BTreeMap in Rust Read More »