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

Feature: Case enumeration #1

Open
Dzejkop opened this issue Feb 20, 2020 · 0 comments
Open

Feature: Case enumeration #1

Dzejkop opened this issue Feb 20, 2020 · 0 comments
Labels
enhancement New feature or request
Projects

Comments

@Dzejkop
Copy link
Owner

Dzejkop commented Feb 20, 2020

Syntax:

section "whatever" {
  each msg in ["Hello", "World"] {
    then "should be true" { 
      assert!(false, msg);
    }
  }
}

Should expand into

mod section_whatever {
    use super::*;
    
    mod msg_is_hello {
        use super::*;
        
        #[test]
        fn then_should_be_true() {
			{
            	let msg = "Hello";
            	assert!(false, msg);
			}
        }
    }
    
    mod msg_is_world {
        use super::*;
        
        #[test]
        fn then_should_be_true() {
            { 
                let msg = "World";
                assert!(false, msg);
            }
        }
    }
}

Notes:

  1. in each item in items item should be a pattern and items a list of pattern.
  2. item should inserted as the first item in the respective scope
@Dzejkop Dzejkop added the enhancement New feature or request label Feb 20, 2020
@Dzejkop Dzejkop added this to To do in Catchr Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Catchr
  
To do
Development

No branches or pull requests

1 participant