()
| 168 | |
| 169 | |
| 170 | def test_highlight_json_with_indent(): |
| 171 | json_string = json.dumps({"name": "apple", "count": 1}, indent=4) |
| 172 | text = Text(json_string) |
| 173 | highlighter = JSONHighlighter() |
| 174 | highlighter.highlight(text) |
| 175 | assert text.spans == [ |
| 176 | Span(0, 1, "json.brace"), |
| 177 | Span(6, 12, "json.str"), |
| 178 | Span(14, 21, "json.str"), |
| 179 | Span(27, 34, "json.str"), |
| 180 | Span(36, 37, "json.number"), |
| 181 | Span(38, 39, "json.brace"), |
| 182 | Span(6, 12, "json.key"), |
| 183 | Span(27, 34, "json.key"), |
| 184 | ] |
| 185 | |
| 186 | |
| 187 | def test_highlight_json_string_only(): |
nothing calls this directly
no test coverage detected