(text: &str, message: &str)
| 582 | |
| 583 | #[track_caller] |
| 584 | fn assert_has_strict_error(text: &str, message: &str) { |
| 585 | let result = parse_to_ast( |
| 586 | text, |
| 587 | &Default::default(), |
| 588 | &ParseOptions { |
| 589 | allow_comments: false, |
| 590 | allow_loose_object_property_names: false, |
| 591 | allow_trailing_commas: false, |
| 592 | allow_missing_commas: false, |
| 593 | allow_single_quoted_strings: false, |
| 594 | allow_hexadecimal_numbers: false, |
| 595 | allow_unary_plus_numbers: false, |
| 596 | }, |
| 597 | ); |
| 598 | match result { |
| 599 | Ok(_) => panic!("Expected error, but did not find one."), |
| 600 | Err(err) => assert_eq!(err.to_string(), message), |
| 601 | } |
| 602 | } |
| 603 | |
| 604 | #[test] |
| 605 | fn it_should_not_include_tokens_by_default() { |
searching dependent graphs…