| 3829 | |
| 3830 | #[test] |
| 3831 | fn test_fstring() { |
| 3832 | for test_case in &[ |
| 3833 | "f'a'", |
| 3834 | "f'hello_{a}'", |
| 3835 | "f'hello_{a} {b}'", |
| 3836 | "f'hello_{a} {b} {c}'", |
| 3837 | // unsupported |
| 3838 | // "f'hello_{f'''{a}'''}'", |
| 3839 | ] { |
| 3840 | let mut parser = Parser::new(test_case); |
| 3841 | let program = parser.parse().expect("parsing failed"); |
| 3842 | |
| 3843 | insta::with_settings!({ |
| 3844 | description => test_case.to_string(), // the template source code |
| 3845 | snapshot_path => "../../test_data/output/", |
| 3846 | omit_expression => true // do not include the default expression |
| 3847 | }, { |
| 3848 | assert_debug_snapshot!(program); |
| 3849 | }); |
| 3850 | } |
| 3851 | } |
| 3852 | |
| 3853 | #[test] |
| 3854 | fn test_comparison() { |