Skip to content

refactor: Refactor Unit Tests to Co-Locate with Source Modules #402

Description

@JoshuaChi

Currently, unit tests are registered centrally through mod.rs files:

pub mod read_lease;
#[cfg(test)]
mod read_lease_test;

This pattern requires maintaining test module declarations separately from the source files and causes mod.rs files to accumulate test-related boilerplate.

Refactor unit tests to be co-located with their corresponding source modules using Rust’s inline test module pattern:

// read_lease.rs
#[cfg(test)]
#[path = "read_lease_test.rs"]
mod tests;

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:enhancementNew feature or request for improvementtype:refactorCode restructuring without changing external behavior

    Type

    Fields

    No fields configured for Task.

    Projects

    Status
    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions