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

More test coverage.

This commit is contained in:
Jakub Sobon 2018-12-30 22:34:36 -05:00
parent 27079c8068
commit 7008fa292f
No known key found for this signature in database
GPG Key ID: F2451A77FB05D3B7

View File

@ -245,6 +245,70 @@ func TestBrailleLine(t *testing.T) {
testbraille.MustSetPixel(bc, image.Point{1, 2})
testbraille.MustSetPixel(bc, image.Point{0, 3})
testbraille.MustApply(bc, ft)
return ft
},
},
{
desc: "draws horizontal line, octant E",
canvas: image.Rect(0, 0, 1, 1),
start: image.Point{0, 0},
end: image.Point{1, 0},
want: func(size image.Point) *faketerm.Terminal {
ft := faketerm.MustNew(size)
bc := testbraille.MustNew(ft.Area())
testbraille.MustSetPixel(bc, image.Point{0, 0})
testbraille.MustSetPixel(bc, image.Point{1, 0})
testbraille.MustApply(bc, ft)
return ft
},
},
{
desc: "draws horizontal line, octant W",
canvas: image.Rect(0, 0, 1, 1),
start: image.Point{1, 0},
end: image.Point{0, 0},
want: func(size image.Point) *faketerm.Terminal {
ft := faketerm.MustNew(size)
bc := testbraille.MustNew(ft.Area())
testbraille.MustSetPixel(bc, image.Point{0, 0})
testbraille.MustSetPixel(bc, image.Point{1, 0})
testbraille.MustApply(bc, ft)
return ft
},
},
{
desc: "draws vertical line, octant S",
canvas: image.Rect(0, 0, 1, 1),
start: image.Point{0, 0},
end: image.Point{0, 1},
want: func(size image.Point) *faketerm.Terminal {
ft := faketerm.MustNew(size)
bc := testbraille.MustNew(ft.Area())
testbraille.MustSetPixel(bc, image.Point{0, 0})
testbraille.MustSetPixel(bc, image.Point{0, 1})
testbraille.MustApply(bc, ft)
return ft
},
},
{
desc: "draws vertical line, octant N",
canvas: image.Rect(0, 0, 1, 1),
start: image.Point{0, 1},
end: image.Point{0, 0},
want: func(size image.Point) *faketerm.Terminal {
ft := faketerm.MustNew(size)
bc := testbraille.MustNew(ft.Area())
testbraille.MustSetPixel(bc, image.Point{0, 0})
testbraille.MustSetPixel(bc, image.Point{0, 1})
testbraille.MustApply(bc, ft)
return ft
},