Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test functions should work when defined inside other functions #612

Open
steveklabnik opened this issue Jan 21, 2015 · 2 comments
Open

Test functions should work when defined inside other functions #612

steveklabnik opened this issue Jan 21, 2015 · 2 comments
Labels
T-compiler Relevant to the compiler team, which will review and decide on the RFC. T-lang Relevant to the language team, which will review and decide on the RFC.

Comments

@steveklabnik
Copy link
Member

Issue by brson
Wednesday Sep 19, 2012 at 01:12 GMT

For earlier discussion, see rust-lang/rust#3532

This issue was labelled with: A-frontend, A-testsuite, E-hard, I-wishlist in the Rust repository


This doesn't work, but I frequently want to do it

fn foo() {

  ...

  #[test]
  fn test1() { }
}

The generated code for running test functions uses paths to the tests, and it's not possible to generate a path to test1. The test runner already breaks resolution rules to run private tests, so maybe we can break yet more.

We would want to consider though how this could work with reflection-based test runners - the way we currently break visibility rules to run tests is already bad news for reflection.

@Kimundi
Copy link
Member

Kimundi commented Jan 21, 2015

See rust-lang/rust#19694

zgotsch added a commit to zgotsch/rethink-rs that referenced this issue Aug 19, 2015
@petrochenkov petrochenkov added T-lang Relevant to the language team, which will review and decide on the RFC. T-compiler Relevant to the compiler team, which will review and decide on the RFC. labels Jan 19, 2018
@Centril
Copy link
Contributor

Centril commented Oct 7, 2018

cc #2471

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-compiler Relevant to the compiler team, which will review and decide on the RFC. T-lang Relevant to the language team, which will review and decide on the RFC.
Projects
None yet
Development

No branches or pull requests

4 participants