Add unit test for function declaration formatting

This commit is contained in:
Patrick Lühne 2020-03-30 05:07:17 +02:00
parent 23e1854346
commit 5c51018ab1
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

View File

@ -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()
{