Skip to content

benracine/incremental-demos

Repository files navigation

Rust Demos

A workspace containing multiple small Rust demonstration projects with comprehensive testing and modern tooling.

Projects

  • 01_hello_world: Simple hello world with unit tests, integration tests, and doctests
  • 02_add_two_numbers: Interactive calculator with input validation and comprehensive testing
  • 03_axum_hello_world: Modern async web server with HTTP endpoint testing

Features

  • 🦀 Modern Rust with 2021 edition
  • 🏗️ Workspace-based dependency management
  • 🧪 Comprehensive testing (unit, integration, doctests)
  • 📊 Code coverage reporting with tarpaulin
  • 🌐 Real HTTP integration testing with reqwest
  • 🎯 Lint configuration for code quality
  • 🔧 Unified spawn functions for easy testing

Quick Start

# Build all projects
cargo build --workspace

# Run all tests
cargo test --workspace

# Generate coverage report
cargo tarpaulin --workspace --out Html

# Run individual projects
cargo run -p hello_world
cargo run -p add_two_numbers  
cargo run -p axum_hello_world

Testing

Each project includes multiple test types:

  • Unit tests in src/ files
  • Integration tests in tests/ directories
  • Documentation tests in rustdoc comments

The Axum project features real HTTP integration testing by spawning the server and making actual requests.

Development

All dependencies are managed at the workspace level for consistency. The workspace uses resolver v2 for optimal dependency unification.

About

Simple Rust demos that incrementally build upon each other

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published