| 3852 | |
| 3853 | #[test] |
| 3854 | fn test_comparison() { |
| 3855 | for test_case in &[ |
| 3856 | "a == b", |
| 3857 | "a != b", |
| 3858 | "a > b", |
| 3859 | "a < b", |
| 3860 | "a >= b", |
| 3861 | "a <= b", |
| 3862 | "a is b", |
| 3863 | "a is not b", |
| 3864 | "a in b", |
| 3865 | "a not in b", |
| 3866 | "a < b < c", |
| 3867 | ] { |
| 3868 | let mut parser = Parser::new(test_case); |
| 3869 | let program = parser.parse().expect("parsing failed"); |
| 3870 | |
| 3871 | insta::with_settings!({ |
| 3872 | description => test_case.to_string(), // the template source code |
| 3873 | snapshot_path => "../../test_data/output/", |
| 3874 | omit_expression => true // do not include the default expression |
| 3875 | }, { |
| 3876 | assert_debug_snapshot!(program); |
| 3877 | }); |
| 3878 | } |
| 3879 | } |
| 3880 | |
| 3881 | #[test] |
| 3882 | fn test_while_statement() { |