()
| 346 | |
| 347 | #[test] |
| 348 | fn unclosed_array() { |
| 349 | bind_context!(let context = "[1, 2"); |
| 350 | bind_state!(let mut state from context); |
| 351 | |
| 352 | let token = state |
| 353 | .advance(SyntaxKind::LBracket) |
| 354 | .expect("should have at least one token"); |
| 355 | |
| 356 | let result: Result<_, ArrayDiagnostic> = visit_array(&mut state, token, |state| { |
| 357 | state |
| 358 | .advance(SyntaxKindSet::COMPLETE) |
| 359 | .expect("should have at least one token"); |
| 360 | Ok(()) |
| 361 | }); |
| 362 | |
| 363 | let diagnostic = result.expect_err("should fail with unclosed array"); |
| 364 | let report = render_diagnostic(context.input, &diagnostic, &context.spans); |
| 365 | |
| 366 | with_settings!({ |
| 367 | description => "Unclosed array should fail" |
| 368 | }, { |
| 369 | assert_snapshot!(insta::_macro_support::AutoName, report, &context.input); |
| 370 | }); |
| 371 | } |
| 372 | |
| 373 | #[test] |
| 374 | fn empty_array_with_whitespace() { |
nothing calls this directly
no test coverage detected