github.com/oweisse/u-root@v0.0.0-20181109060735-d005ad25fef1/cmds/elvish/edit/navigation_widths_test.go (about)

     1  package edit
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/u-root/u-root/cmds/elvish/tt"
     7  )
     8  
     9  var (
    10  	getNavWidthsTests = tt.Table{
    11  		// Enough room for both current and preview: parent gets 1/6, current
    12  		// and preview gets 1/2 of remain
    13  		tt.Args(120, 10, 10).Rets(20, 50, 50),
    14  		// Not enough room for either of current and preview: same as above
    15  		tt.Args(120, 100, 100).Rets(20, 50, 50),
    16  		// Enough room for current but not preview; current donates to preview
    17  		tt.Args(120, 10, 100).Rets(20, 10, 90),
    18  		// Enough room for preview but not current; preview donates to current
    19  		tt.Args(120, 100, 10).Rets(20, 90, 10),
    20  	}
    21  )
    22  
    23  func TestGetNavWidths(t *testing.T) {
    24  	tt.Test(t, tt.Fn("getNavWidths", getNavWidths), getNavWidthsTests)
    25  }