Skip to content

rosew0od/test_pairs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple testing library that allows you to test pairs. A simple example for testing that adding and subtracting are working:

#[test]
fn adding() {
    let pairs = [
        (0, 1),
        (2, 3),
        (3, 4)
    ];
    test_pairs(
        &pairs,
        |a, b| a + 1,
        |b, a| b - 1
    );
}

If you only want to test turning a into b, but not b into a, you can simply return a:

#[test]
fn adding() {
    let pairs = [
        (0, 1),
        (2, 3),
        (3, 4)
    ];
    test_pairs(
        &pairs,
        |a, b| a + 1,
        |b, a| a
    );
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages