Make functions cloneable for testing.
It's not super fast to clone a function, but it is faster than re-parsing the test case file it came from. Some tests want to mutate the function, and there may be other tests in the same script that need the original function.
This commit is contained in:
@@ -9,6 +9,10 @@ use entity_map::{EntityMap, PrimaryEntityData};
|
||||
use std::fmt::{self, Debug, Formatter};
|
||||
|
||||
/// A function.
|
||||
///
|
||||
/// Functions can be cloned, but it is not a very fast operation.
|
||||
/// The clone will have all the same entity numbers as the original.
|
||||
#[derive(Clone)]
|
||||
pub struct Function {
|
||||
/// Name of this function. Mostly used by `.cton` files.
|
||||
pub name: FunctionName,
|
||||
|
||||
Reference in New Issue
Block a user