[go: up one dir, main page]

test-case 0.3.1

Provides #[test_case(...)] procedural macro attribute for generating parametrized test cases easily
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::test_case::TestCase;
use syn::parenthesized;
use syn::parse::{Parse, ParseStream};
use syn::Error;

pub struct ParentedTestCase {
    pub test_case: TestCase,
}

impl Parse for ParentedTestCase {
    fn parse(input: ParseStream) -> Result<Self, Error> {
        let content;
        let _ = parenthesized!(content in input);
        let test_case = TestCase::parse(&content)?;
        Ok(Self { test_case })
    }
}