elvish/pkg/eval/vals/bool_test.go
Kurtis Rader 71cd3835bc Don't dot import pkg/tt
Qualified imports of pkg/tt outnumber unqualified (27 to 24). Improve
consistency, and clarity, by changing the dot (unqualified) imports of
that package symbols to qualified.
2022-06-04 23:39:19 +01:00

28 lines
453 B
Go

package vals
import (
"testing"
"src.elv.sh/pkg/tt"
)
type customBooler struct{ b bool }
func (b customBooler) Bool() bool { return b.b }
type customNonBooler struct{}
func TestBool(t *testing.T) {
tt.Test(t, tt.Fn("Bool", Bool), tt.Table{
Args(nil).Rets(false),
Args(true).Rets(true),
Args(false).Rets(false),
Args(customBooler{true}).Rets(true),
Args(customBooler{false}).Rets(false),
Args(customNonBooler{}).Rets(true),
})
}