github.com/insomniacslk/u-root@v0.0.0-20200717035308-96b791510d76/cmds/core/true/true_test.go (about)

     1  // Copyright 2017 the u-root Authors. All rights reserved
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package main
     6  
     7  import (
     8  	"testing"
     9  
    10  	"github.com/u-root/u-root/pkg/testutil"
    11  )
    12  
    13  // Ensure 0 is returned.
    14  func TestTrue(t *testing.T) {
    15  	out, err := testutil.Command(t).CombinedOutput()
    16  	if err != nil || len(out) != 0 {
    17  		t.Fatal("Expected no output and no error")
    18  	}
    19  }
    20  
    21  func TestMain(m *testing.M) {
    22  	testutil.Run(m, main)
    23  }