github.com/grahambrereton-form3/tilt@v0.10.18/internal/rty/box_test.go (about)

     1  package rty
     2  
     3  import "testing"
     4  
     5  func TestBoxes(t *testing.T) {
     6  	i := NewInteractiveTester(t, screen)
     7  
     8  	i.Run("10x10 box", 10, 10, NewGrowingBox())
     9  	b := NewGrowingBox()
    10  	b.SetInner(TextString("hello world"))
    11  	i.Run("text in box", 20, 10, b)
    12  	i.Run("wrapped text in box", 10, 10, b)
    13  	b.SetTitle("so very important")
    14  	i.Run("box with title", 20, 10, b)
    15  	i.Run("box with short title", 5, 10, b)
    16  
    17  	b = NewBox(TextString("hello world"))
    18  	i.Run("non-growing box", 20, 20, b)
    19  }
    20  
    21  func TestWindows(t *testing.T) {
    22  	i := NewInteractiveTester(t, screen)
    23  
    24  	i.Run("10x10 window", 10, 10, NewGrowingWindow())
    25  	window := NewGrowingWindow()
    26  	window.SetInner(TextString("hello world"))
    27  	i.Run("text in window", 20, 10, window)
    28  	i.Run("wrapped text in window", 10, 10, window)
    29  	window.SetTitle("so very important")
    30  	i.Run("window with title", 20, 10, window)
    31  	i.Run("window with short title", 5, 10, window)
    32  
    33  	window = NewWindow(TextString("hello world"))
    34  	i.Run("non-growing window", 20, 20, window)
    35  }