Fixing build and test errors.

This commit is contained in:
Jakub Sobon 2018-04-02 00:47:08 +02:00
parent 19fb73bc55
commit 16de0d2b87
No known key found for this signature in database
GPG Key ID: F2451A77FB05D3B7
4 changed files with 2 additions and 86 deletions

View File

@ -38,7 +38,7 @@ func TestBox(t *testing.T) {
desc: "unsupported line style",
canvas: image.Rect(0, 0, 4, 4),
box: image.Rect(0, 0, 2, 2),
ls: lineStyleUnknown,
ls: LineStyle(-1),
wantErr: true,
},
{

View File

@ -1,53 +0,0 @@
// Binary boxes just creates containers with borders.
package main
import (
"time"
"github.com/mum4k/termdash/container"
"github.com/mum4k/termdash/draw"
"github.com/mum4k/termdash/terminal/termbox"
)
func main() {
t, err := termbox.New()
if err != nil {
panic(err)
}
defer t.Close()
c := container.New(
t,
container.SplitVertical(
container.Left(
container.SplitHorizontal(
container.Top(
container.Border(draw.LineStyleLight),
),
container.Bottom(
container.SplitHorizontal(
container.Top(
container.Border(draw.LineStyleLight),
),
container.Bottom(
container.Border(draw.LineStyleLight),
),
),
),
),
),
container.Right(
container.Border(draw.LineStyleLight),
),
),
)
if err := c.Draw(); err != nil {
panic(err)
}
if err := t.Flush(); err != nil {
panic(err)
}
time.Sleep(3 * time.Second)
}

View File

@ -1,31 +0,0 @@
// Binary term just initializes the terminal and sets a few cells.
package main
import (
"image"
"time"
"github.com/mum4k/termdash/cell"
"github.com/mum4k/termdash/terminal/termbox"
"github.com/mum4k/termdash/terminalapi"
)
func main() {
t, err := termbox.New(termbox.ColorMode(terminalapi.ColorMode256))
if err != nil {
panic(err)
}
defer t.Close()
if err := t.SetCell(image.Point{0, 0}, 'X', cell.FgColor(cell.ColorMagenta)); err != nil {
panic(err)
}
if err := t.SetCell(t.Size().Sub(image.Point{1, 1}), 'X', cell.FgColor(cell.ColorMagenta)); err != nil {
panic(err)
}
if err := t.Flush(); err != nil {
panic(err)
}
time.Sleep(3 * time.Second)
}

View File

@ -58,5 +58,5 @@ func (e *Error) Error() error {
if e == nil || *e == "" {
return nil
}
return errors.New(e)
return errors.New(string(*e))
}