@@ -472,6 +472,13 @@
Loading
472 472
    out.join("\n")
473 473
}
474 474
475 +
pub fn empty_face(width: u32, height: u32) -> String {
476 +
    (0..height)
477 +
        .map(|_| " ".repeat(width as usize))
478 +
        .collect::<Vec<String>>()
479 +
        .join("\n")
480 +
}
481 +
475 482
#[cfg(test)]
476 483
mod tests {
477 484
    use super::*;
@@ -690,4 +697,13 @@
Loading
690 697
        let r = "o#\n#o";
691 698
        assert_eq!(overlay(a, b, -1, -1), r);
692 699
    }
700 +
701 +
    #[test]
702 +
    fn test_empty_face() {
703 +
        assert_eq!(empty_face(0, 0), "");
704 +
        assert_eq!(empty_face(1, 1), " ");
705 +
        assert_eq!(empty_face(2, 2), "  \n  ");
706 +
        assert_eq!(empty_face(2, 3), "  \n  \n  ");
707 +
        assert_eq!(empty_face(4, 2), "    \n    ");
708 +
    }
693 709
}

@@ -182,10 +182,7 @@
Loading
182 182
        let face_lines = if let Some(line_style) = &self.line_style {
183 183
            unimplemented!("Text rendering does not yet support line plots")
184 184
        } else {
185 -
            (0..face_height)
186 -
                .map(|_| " ".repeat(face_width as usize))
187 -
                .collect::<Vec<String>>()
188 -
                .join("\n")
185 +
            text_render::empty_face(face_width, face_height)
189 186
        };
190 187
        let face_points = if let Some(point_style) = &self.point_style {
191 188
            text_render::render_face_points(
@@ -197,10 +194,7 @@
Loading
197 194
                &point_style,
198 195
            )
199 196
        } else {
200 -
            (0..face_height)
201 -
                .map(|_| " ".repeat(face_width as usize))
202 -
                .collect::<Vec<String>>()
203 -
                .join("\n")
197 +
            text_render::empty_face(face_width, face_height)
204 198
        };
205 199
        text_render::overlay(&face_lines, &face_points, 0, 0)
206 200
    }
Files Coverage
src 62.44%
tests/test_no_data.rs 100.00%
Project Totals (14 files) 63.17%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading