()
| 768 | |
| 769 | #[test] |
| 770 | fn parse_relative_path_match() { |
| 771 | let json = r#"{ |
| 772 | "totals": {"errors": 0, "file_errors": 1}, |
| 773 | "files": { |
| 774 | "/home/user/project/src/Foo.php": { |
| 775 | "errors": 1, |
| 776 | "messages": [ |
| 777 | { |
| 778 | "message": "Error in Foo.", |
| 779 | "line": 3, |
| 780 | "ignorable": true, |
| 781 | "identifier": "phpstan" |
| 782 | } |
| 783 | ] |
| 784 | } |
| 785 | }, |
| 786 | "errors": [] |
| 787 | }"#; |
| 788 | // Use a relative path that should still match via suffix. |
| 789 | let path = Path::new("src/Foo.php"); |
| 790 | let diags = parse_phpstan_json(json, path).unwrap(); |
| 791 | assert_eq!(diags.len(), 1); |
| 792 | } |
| 793 | |
| 794 | #[test] |
| 795 | fn parse_no_matching_file() { |
nothing calls this directly
no test coverage detected