MCPcopy Create free account
hub / github.com/Glyphack/enderpy / test_try_statement

Function test_try_statement

parser/src/parser/parser.rs:3907–3952  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3905
3906 #[test]
3907 fn test_try_statement() {
3908 for test_case in &[
3909 "try:
3910 pass
3911except:
3912 pass",
3913 "try:
3914 pass
3915except Exception:
3916 pass",
3917 "try:
3918 pass
3919except Exception as e:
3920 pass",
3921 "try:
3922 pass
3923except Exception as e:
3924 pass
3925else:
3926 pass",
3927 "try:
3928 pass
3929except Exception as e:
3930 pass
3931else:
3932 pass
3933finally:
3934 pass",
3935 "try:
3936 pass
3937except *Exception as e:
3938 pass
3939",
3940 ] {
3941 let mut parser = Parser::new(test_case);
3942 let program = parser.parse().expect("parsing failed");
3943
3944 insta::with_settings!({
3945 description => test_case.to_string(), // the template source code
3946 snapshot_path => "../../test_data/output/",
3947 omit_expression => true // do not include the default expression
3948 }, {
3949 assert_debug_snapshot!(program);
3950 });
3951 }
3952 }
3953
3954 #[test]
3955 fn test_ellipsis_statement() {

Callers

nothing calls this directly

Calls 2

expectMethod · 0.80
parseMethod · 0.80

Tested by

no test coverage detected