Skip to content

Inner function cannot be tested #36629

Open
@kindlychung

Description

@kindlychung

I really would like to be able to this:

fn outer(x: i32) -> i32 {
    fn inner(a: i32, b: i32) -> i32 {
        a + b
    }
    #[test]
    fn test_inner() {
        assert_eq!(inner(3, 5), 8);
    }
    inner(x, 5)
}

#[test]
fn test_outer() {
    assert_eq!(outer(3), 8);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-libtestArea: `#[test]` / the `test` libraryC-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions