Add unit test for function declaration formatting
This commit is contained in:
parent
23e1854346
commit
5c51018ab1
@ -435,6 +435,16 @@ mod tests
|
||||
// TODO: escape functions that start with capital letters or that conflict with keywords
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn format_function_declaration()
|
||||
{
|
||||
assert_eq!(format!("{}", function_declaration("a", 0)), "a/0");
|
||||
assert_eq!(format!("{}", function_declaration("constant", 0)), "constant/0");
|
||||
assert_eq!(format!("{}", function_declaration("f", 1)), "f/1");
|
||||
assert_eq!(format!("{}", function_declaration("f", 3)), "f/3");
|
||||
assert_eq!(format!("{}", function_declaration("function", 3)), "function/3");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn format_variable()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user