Skip to content

Commit

Permalink
Update parser_tests.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lokathor authored Oct 22, 2024
1 parent 60c2bf5 commit 08b6b8b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/parser_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn can_parse_empty_main_fn() {
let src = r#" fn main() {} "#;
let items = parse_items_no_errors(src);
match items.as_slice() {
[item] => match item._payload {
[item] => match &item._payload {
Item::Fn(FnDecl { name, args, statements }) => {
assert_eq!(name.as_str(), "main");
assert!(args.is_empty());
Expand All @@ -36,7 +36,7 @@ fn can_parse_empty_main_fn() {
let src = r#" fn main() { } "#;
let items = parse_items_no_errors(src);
match items.as_slice() {
[item] => match item._payload {
[item] => match &item._payload {
Item::Fn(FnDecl { name, args, statements }) => {
assert_eq!(name.as_str(), "main");
assert!(args.is_empty());
Expand All @@ -53,7 +53,7 @@ fn can_parse_empty_main_fn() {
} "#;
let items = parse_items_no_errors(src);
match items.as_slice() {
[item] => match item._payload {
[item] => match &item._payload {
Item::Fn(FnDecl { name, args, statements }) => {
assert_eq!(name.as_str(), "main");
assert!(args.is_empty());
Expand All @@ -71,7 +71,7 @@ fn can_parse_return_statement() {
let src = r#" fn main() { return } "#;
let items = parse_items_no_errors(src);
match items.as_slice() {
[item] => match item._payload {
[item] => match &item._payload {
Item::Fn(FnDecl { name, args, statements }) => {
assert_eq!(name.as_str(), "main");
assert!(args.is_empty());
Expand All @@ -92,7 +92,7 @@ fn can_parse_return_statement() {
} "#;
let items = parse_items_no_errors(src);
match items.as_slice() {
[(item, _file_span)] => match item {
[item] => match &item._payload {
Item::Fn(FnDecl { name, args, statements }) => {
assert_eq!(name.as_str(), "main");
assert!(args.is_empty());
Expand Down

0 comments on commit 08b6b8b

Please sign in to comment.