1
0
mirror of https://github.com/mum4k/termdash.git synced 2025-04-27 13:48:49 +08:00

Improving test coverage.

This commit is contained in:
Jakub Sobon 2019-01-19 02:06:48 -05:00
parent 50a734d77a
commit 045bd3ffd1
No known key found for this signature in database
GPG Key ID: F2451A77FB05D3B7
2 changed files with 20 additions and 0 deletions

View File

@ -67,6 +67,16 @@ func TestBrailleCircle(t *testing.T) {
radius: 2,
wantErr: true,
},
{
desc: "fails when clearing a circle that doesn't fit",
canvas: image.Rect(0, 0, 1, 1),
mid: image.Point{0, 0},
radius: 2,
opts: []BrailleCircleOption{
BrailleCircleClearPixels(),
},
wantErr: true,
},
{
desc: "fails when the filled circle doesn't fit",
canvas: image.Rect(0, 0, 1, 1),

View File

@ -81,6 +81,16 @@ func TestBrailleLine(t *testing.T) {
end: image.Point{6, 3},
wantErr: true,
},
{
desc: "low line, fails on end point outside of the canvas when clearing pixels",
canvas: image.Rect(0, 0, 3, 1),
start: image.Point{0, 0},
end: image.Point{6, 3},
opts: []BrailleLineOption{
BrailleLineClearPixels(),
},
wantErr: true,
},
{
desc: "high line, fails on end point outside of the canvas",
canvas: image.Rect(0, 0, 1, 1),