cleaner test code

This commit is contained in:
Aidan Hahn 2021-11-02 20:12:14 -07:00
parent 0606b985e6
commit e139756a81
No known key found for this signature in database
GPG key ID: 327711E983899316

View file

@ -59,7 +59,7 @@ mod func_tests {
#[test] #[test]
fn decl_and_call_external_func_singlet() { fn decl_and_call_external_func_singlet() {
match lex("((input))".to_string()) { match lex("((input))".to_string()) {
Err(e) => panic!(e), Err(e) => panic!("{}", e),
Ok(finner) => { Ok(finner) => {
let test_external_func: Function = Function{ let test_external_func: Function = Function{
name: String::from("echo"), name: String::from("echo"),
@ -113,7 +113,7 @@ mod func_tests {
#[test] #[test]
fn decl_and_call_external_func_multi_body() { fn decl_and_call_external_func_multi_body() {
match lex("((input) (input))".to_string()) { match lex("((input) (input))".to_string()) {
Err(e) => panic!(e), Err(e) => panic!("{}", e),
Ok(finner) => { Ok(finner) => {
let test_external_func: Function = Function{ let test_external_func: Function = Function{
name: String::from("echo_2"), name: String::from("echo_2"),
@ -191,7 +191,7 @@ mod func_tests {
}; };
match lex("((test_inner true))".to_string()) { match lex("((test_inner true))".to_string()) {
Err(e) => panic!(e), Err(e) => panic!("{}", e),
Ok(finner) => { Ok(finner) => {
let outer_func: Function = Function{ let outer_func: Function = Function{
name: String::from("test_outer"), name: String::from("test_outer"),