()
| 620 | |
| 621 | #[test] |
| 622 | fn parse_no_matching_file() { |
| 623 | let json = r#"{ |
| 624 | "totals": {"errors": 1, "warnings": 0, "fixable": 0}, |
| 625 | "files": { |
| 626 | "/project/src/Bar.php": { |
| 627 | "errors": 1, |
| 628 | "warnings": 0, |
| 629 | "messages": [ |
| 630 | { |
| 631 | "message": "Error in Bar.", |
| 632 | "source": "Generic.Sniff.Name", |
| 633 | "severity": 5, |
| 634 | "fixable": false, |
| 635 | "type": "ERROR", |
| 636 | "line": 1, |
| 637 | "column": 1 |
| 638 | } |
| 639 | ] |
| 640 | }, |
| 641 | "/project/src/Baz.php": { |
| 642 | "errors": 0, |
| 643 | "warnings": 0, |
| 644 | "messages": [] |
| 645 | } |
| 646 | } |
| 647 | }"#; |
| 648 | let path = Path::new("/project/src/Foo.php"); |
| 649 | let diags = parse_phpcs_json(json, path).unwrap(); |
| 650 | assert!(diags.is_empty()); |
| 651 | } |
| 652 | |
| 653 | #[test] |
| 654 | fn parse_invalid_json() { |
nothing calls this directly
no test coverage detected