2017-01-13 23:07:43 -07:00
|
|
|
// Copyright 2017 Zack Guo <zack.y.guo@gmail.com>. All rights reserved.
|
2016-01-26 18:45:18 -07:00
|
|
|
// Use of this source code is governed by a MIT license that can
|
|
|
|
// be found in the LICENSE file.
|
|
|
|
|
2015-06-01 22:53:57 -06:00
|
|
|
package termui
|
|
|
|
|
|
|
|
import "testing"
|
|
|
|
|
|
|
|
func TestPar_NoBorderBackground(t *testing.T) {
|
|
|
|
par := NewPar("a")
|
2015-10-22 09:17:20 -06:00
|
|
|
par.Border = false
|
|
|
|
par.Bg = ColorBlue
|
2015-06-01 22:53:57 -06:00
|
|
|
par.TextBgColor = ColorBlue
|
|
|
|
par.Width = 2
|
|
|
|
par.Height = 2
|
|
|
|
|
|
|
|
pts := par.Buffer()
|
2015-10-22 09:17:20 -06:00
|
|
|
for _, p := range pts.CellMap {
|
2015-06-01 22:53:57 -06:00
|
|
|
t.Log(p)
|
2015-10-22 09:17:20 -06:00
|
|
|
if p.Bg != par.Bg {
|
|
|
|
t.Errorf("expected color to be %v but got %v", par.Bg, p.Bg)
|
2015-06-01 22:53:57 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|