Skip to content

Remove test-clarity-vN features #551

Open
@ureeves

Description

@ureeves

Since the clarity version and epoch can be selected at runtime in using the TestEnvironment struct, the test-clarity-vN features requiring us to build the tests three different times (once for each clarity version) are unnecessary and should be replaced by better infrastructure.

One alternative is to introduce a procedural macro that takes in a test function and a version selection. The macro would generate code instantiating a TestEnvironment using the selected version and injecting it into the function provided:

#[test_with_env(v1, v2)]
fn the_test(env: TestEnvironment) {
    // test code
}

// expands into...

#[test]
fn the_test_v1() {
    let env = TestEnvironment::new(/*version 1 and epoch*/)
    // test code
}

#[test]
fn the_test_v2() {
    let env = TestEnvironment::new(/*version 2 and epoch*/)
    // test code
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    code qualityImproving the quality of the code, and dev experiencetesting

    Type

    No type

    Projects

    Status

    Status: 🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions