Break DetailedFunction into a tuple.

Use (Function, Details) in place of the aggregrate DetailedFunction.
It turns out that some tests want to clone and manipulate the function
while the details never change.
This commit is contained in:
Jakob Stoklund Olesen
2016-09-15 08:32:03 -07:00
parent a24ca56c0d
commit 2901a85a36
3 changed files with 50 additions and 54 deletions

View File

@@ -15,14 +15,14 @@ use testcommand::TestCommand;
#[derive(Debug)]
pub struct TestFile<'a> {
pub commands: Vec<TestCommand<'a>>,
pub functions: Vec<DetailedFunction<'a>>,
pub functions: Vec<(Function, Details<'a>)>,
}
/// A function parsed from a text string along with other details that are useful for running
/// tests.
/// Additional details about a function parsed from a text string.
/// These are useful for detecting test commands embedded in comments etc.
/// The details to not affect the semantics of the function.
#[derive(Debug)]
pub struct DetailedFunction<'a> {
pub function: Function,
pub struct Details<'a> {
pub comments: Vec<Comment<'a>>,
}