()
| 479 | |
| 480 | #[test] |
| 481 | fn deep_nesting() { |
| 482 | bind_context!(let context = "[[[1]]]"); |
| 483 | bind_state!(let mut state from context); |
| 484 | |
| 485 | let token = state |
| 486 | .advance(SyntaxKind::LBracket) |
| 487 | .expect("should have at least one token"); |
| 488 | |
| 489 | let mut depth = 0; |
| 490 | |
| 491 | let result = visit_array(&mut state, token, |state| { |
| 492 | process_nested_array(state, &mut depth) |
| 493 | }); |
| 494 | |
| 495 | let range = result.expect("should be able to parse deeply nested arrays"); |
| 496 | assert_eq!(range.start(), TextSize::new(0)); |
| 497 | assert_eq!(range.end(), TextSize::new(7)); |
| 498 | assert_eq!(depth, 3); |
| 499 | } |
| 500 | |
| 501 | #[test] |
| 502 | fn empty_nested_arrays() { |
nothing calls this directly
no test coverage detected