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:
parent
27079c8068
commit
7008fa292f
@ -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
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user