()
| 1288 | |
| 1289 | #[test] |
| 1290 | fn catch_body() { |
| 1291 | let content = r#"<?php |
| 1292 | try { |
| 1293 | echo "try"; |
| 1294 | } catch (\Exception $e) { |
| 1295 | echo "catch"; |
| 1296 | } finally { |
| 1297 | echo "finally"; |
| 1298 | } |
| 1299 | "#; |
| 1300 | // Cursor on "catch" string (line 4, char 10). |
| 1301 | let results = selection_ranges(content, &[Position::new(4, 10)]); |
| 1302 | assert_eq!(results.len(), 1); |
| 1303 | let ranges = flatten(&results[0]); |
| 1304 | // string → echo → catch block body → catch block → catch clause → try stmt → file |
| 1305 | assert!( |
| 1306 | ranges.len() >= 5, |
| 1307 | "Expected at least 5 levels for catch body, got {}", |
| 1308 | ranges.len() |
| 1309 | ); |
| 1310 | assert_nested(&ranges); |
| 1311 | } |
| 1312 | |
| 1313 | #[test] |
| 1314 | fn finally_body() { |
nothing calls this directly
no test coverage detected