par_test.go 534 B

12345678910111213141516171819202122232425
  1. // Copyright 2017 Zack Guo <zack.y.guo@gmail.com>. All rights reserved.
  2. // Use of this source code is governed by a MIT license that can
  3. // be found in the LICENSE file.
  4. package termui
  5. import "testing"
  6. func TestPar_NoBorderBackground(t *testing.T) {
  7. par := NewPar("a")
  8. par.Border = false
  9. par.Bg = ColorBlue
  10. par.TextBgColor = ColorBlue
  11. par.Width = 2
  12. par.Height = 2
  13. pts := par.Buffer()
  14. for _, p := range pts.CellMap {
  15. t.Log(p)
  16. if p.Bg != par.Bg {
  17. t.Errorf("expected color to be %v but got %v", par.Bg, p.Bg)
  18. }
  19. }
  20. }