Search in sources :

Example 21 with LineData

use of com.intellij.rt.coverage.data.LineData in project intellij by bazelbuild.

the class BlazeCoverageRunnerTest method testParseSingleFile.

@Test
public void testParseSingleFile() throws IOException {
    ProjectData data = BlazeCoverageRunner.parseCoverage(mockResolver, inputStream("SF:path/to/file.txt", "DA:4,0", "DA:8,0", "DA:9,1", "DA:23,3", "end_of_record"));
    assertThat(data.getClasses()).hasSize(1);
    LineData[] lines = (LineData[]) data.getClassData("/root/path/to/file.txt").getLines();
    assertThat(lines).hasLength(24);
    assertEquals(lines[4], lineData(4, 0));
    assertEquals(lines[9], lineData(9, 1));
    assertEquals(lines[23], lineData(23, 3));
}
Also used : LineData(com.intellij.rt.coverage.data.LineData) ProjectData(com.intellij.rt.coverage.data.ProjectData) Test(org.junit.Test)

Aggregations

LineData (com.intellij.rt.coverage.data.LineData)21 ClassData (com.intellij.rt.coverage.data.ClassData)11 ProjectData (com.intellij.rt.coverage.data.ProjectData)10 VirtualFile (com.intellij.openapi.vfs.VirtualFile)5 Nullable (org.jetbrains.annotations.Nullable)5 Document (com.intellij.openapi.editor.Document)4 PsiFile (com.intellij.psi.PsiFile)4 Map (java.util.Map)4 NotNull (org.jetbrains.annotations.NotNull)4 Module (com.intellij.openapi.module.Module)3 File (java.io.File)3 FileInputStream (java.io.FileInputStream)3 CoverageReport (com.google.jstestdriver.idea.rt.coverage.CoverageReport)2 Editor (com.intellij.openapi.editor.Editor)2 DocumentAdapter (com.intellij.openapi.editor.event.DocumentAdapter)2 DocumentEvent (com.intellij.openapi.editor.event.DocumentEvent)2 DocumentListener (com.intellij.openapi.editor.event.DocumentListener)2 DocumentMarkupModel (com.intellij.openapi.editor.impl.DocumentMarkupModel)2 FileEditor (com.intellij.openapi.fileEditor.FileEditor)2 TextEditor (com.intellij.openapi.fileEditor.TextEditor)2