()
| 778 | |
| 779 | #[test] |
| 780 | fn parse_full_line_range() { |
| 781 | let json = r#"{ |
| 782 | "totals": {"errors": 1, "warnings": 0, "fixable": 0}, |
| 783 | "files": { |
| 784 | "/project/src/Foo.php": { |
| 785 | "errors": 1, |
| 786 | "warnings": 0, |
| 787 | "messages": [ |
| 788 | { |
| 789 | "message": "Whitespace found.", |
| 790 | "source": "Squiz.WhiteSpace.SuperfluousWhitespace.EndLine", |
| 791 | "severity": 5, |
| 792 | "fixable": true, |
| 793 | "type": "ERROR", |
| 794 | "line": 10, |
| 795 | "column": 5 |
| 796 | } |
| 797 | ] |
| 798 | } |
| 799 | } |
| 800 | }"#; |
| 801 | let path = Path::new("/project/src/Foo.php"); |
| 802 | let diags = parse_phpcs_json(json, path).unwrap(); |
| 803 | assert_eq!(diags.len(), 1); |
| 804 | // Full-line range: column is ignored because its semantics |
| 805 | // vary by sniff (token start vs line length vs other). |
| 806 | assert_eq!(diags[0].range.start.line, 9); |
| 807 | assert_eq!(diags[0].range.start.character, 0); |
| 808 | assert_eq!(diags[0].range.end.line, 9); |
| 809 | assert_eq!(diags[0].range.end.character, u32::MAX); |
| 810 | } |
| 811 | |
| 812 | #[test] |
| 813 | fn parse_stdin_path_key() { |
nothing calls this directly
no test coverage detected