Browse Source

Added some failing async func decl tests

pull/836/head
Paul Lancaster 4 years ago
parent
commit
8507b04f08
  1. 23
      boa/src/syntax/parser/statement/declaration/hoistable/async_function_decl/tests.rs
  2. 23
      boa/src/syntax/parser/statement/declaration/tests.rs

23
boa/src/syntax/parser/statement/declaration/hoistable/async_function_decl/tests.rs

@ -1 +1,24 @@
use crate::syntax::{ast::node::AsyncFunctionDecl, parser::tests::check_parser};
/// Async function declaration parsing.
#[test]
fn async_function_declaration() {
check_parser(
"async function hello() {}",
vec![AsyncFunctionDecl::new(Box::from("hello"), vec![], vec![]).into()],
);
}
/// Async function declaration parsing with keywords.
#[test]
fn async_function_declaration_keywords() {
check_parser(
"async function yield() {}",
vec![AsyncFunctionDecl::new(Box::from("yield"), vec![], vec![]).into()],
);
check_parser(
"async function await() {}",
vec![AsyncFunctionDecl::new(Box::from("await"), vec![], vec![]).into()],
);
}

23
boa/src/syntax/parser/statement/declaration/tests.rs

@ -169,26 +169,3 @@ fn multiple_const_declaration() {
.into()],
);
}
/// Function declaration parsing.
#[test]
fn function_declaration() {
check_parser(
"function hello() {}",
vec![FunctionDecl::new(Box::from("hello"), vec![], vec![]).into()],
);
}
/// Function declaration parsing with keywords.
#[test]
fn function_declaration_keywords() {
check_parser(
"function yield() {}",
vec![FunctionDecl::new(Box::from("yield"), vec![], vec![]).into()],
);
check_parser(
"function await() {}",
vec![FunctionDecl::new(Box::from("await"), vec![], vec![]).into()],
);
}

Loading…
Cancel
Save