MCPcopy Create free account
hub / github.com/dprint/jsonc-parser / assert_has_error

Function assert_has_error

src/parse_to_ast.rs:520–526  ·  view source on GitHub ↗
(text: &str, message: &str)

Source from the content-addressed store, hash-verified

518 }
519
520 fn assert_has_error(text: &str, message: &str) {
521 let result = parse_to_ast(text, &Default::default(), &Default::default());
522 match result {
523 Ok(_) => panic!("Expected error, but did not find one."),
524 Err(err) => assert_eq!(err.to_string(), message),
525 }
526 }
527
528 #[test]
529 fn strict_should_error_object_trailing_comma() {

Calls 1

parse_to_astFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…