MCPcopy Create free account
hub / github.com/hashintel/hash / deep_nesting

Function deep_nesting

libs/@local/hashql/syntax-jexpr/src/parser/array/visit.rs:481–499  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 4

visit_arrayFunction · 0.85
process_nested_arrayFunction · 0.85
expectMethod · 0.45
advanceMethod · 0.45

Tested by

no test coverage detected