From 8507b04f0831bf1973a3677c0524a2b8c5a41c8e Mon Sep 17 00:00:00 2001 From: Paul Lancaster Date: Sat, 10 Oct 2020 14:39:00 +0100 Subject: [PATCH] Added some failing async func decl tests --- .../hoistable/async_function_decl/tests.rs | 23 +++++++++++++++++++ .../parser/statement/declaration/tests.rs | 23 ------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/boa/src/syntax/parser/statement/declaration/hoistable/async_function_decl/tests.rs b/boa/src/syntax/parser/statement/declaration/hoistable/async_function_decl/tests.rs index 8b13789179..a7648b74e5 100644 --- a/boa/src/syntax/parser/statement/declaration/hoistable/async_function_decl/tests.rs +++ b/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()], + ); +} diff --git a/boa/src/syntax/parser/statement/declaration/tests.rs b/boa/src/syntax/parser/statement/declaration/tests.rs index 5ed9bd2d14..1d501148b9 100644 --- a/boa/src/syntax/parser/statement/declaration/tests.rs +++ b/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()], - ); -}