diff --git a/fine/build.rs b/fine/build.rs index 2491adf6..97a76612 100644 --- a/fine/build.rs +++ b/fine/build.rs @@ -10,6 +10,7 @@ fn generate_test_for_file(path: PathBuf) -> String { let display_path = path.display().to_string(); // Start iterating over lines and processing directives.... + let mut disabled = quote! {}; let mut assertions = Vec::new(); let mut lines = contents.lines(); while let Some(line) = lines.next() { @@ -19,7 +20,9 @@ fn generate_test_for_file(path: PathBuf) -> String { }; let line = line.trim(); - if line == "@concrete:" { + if line == "@disabled" { + disabled = quote! { #[ignore] }; + } else if line == "@concrete:" { let mut concrete = String::new(); while let Some(line) = lines.next() { let line = match line.strip_prefix("// | ") { @@ -65,6 +68,7 @@ fn generate_test_for_file(path: PathBuf) -> String { let name = format_ident!("{}", path.file_stem().unwrap().to_string_lossy()); let test_method = quote! { + #disabled fn #name() { let (_tree, _lines) = fine::parser::parse(#contents); #(#assertions)* diff --git a/fine/tests/README.md b/fine/tests/README.md index 62bedeec..e228e6cb 100644 --- a/fine/tests/README.md +++ b/fine/tests/README.md @@ -37,6 +37,8 @@ e.g., a test might look like this: The various assertions are as follows: +- The `// @disabled` directive marks the test as ignored. + - The `// @concrete:` assertion says that the following lines (prefixed with `// | `, as above) describe the concrete syntax tree of the file after parsing. diff --git a/fine/tests/expression/empty_statement.fine b/fine/tests/expression/empty_statement.fine new file mode 100644 index 00000000..710bef3d --- /dev/null +++ b/fine/tests/expression/empty_statement.fine @@ -0,0 +1,5 @@ +// @disabled +// @concrete: +// | + +;