github.com/mvdan/u-root-coreutils@v0.0.0-20230122170626-c2eef2898555/pkg/uroot/util/pkg_test.go (about) 1 // Copyright 2021 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 util 6 7 import ( 8 "bytes" 9 "fmt" 10 "os" 11 "testing" 12 ) 13 14 func TestTODO(t *testing.T) { 15 b := &bytes.Buffer{} 16 f := func() { 17 fmt.Fprintf(b, "hi %s", os.Args[0]) 18 } 19 20 f = Usage(f, "there") 21 f() 22 if b.String() != "hi there" { 23 t.Errorf("f(): Got %q, want %q", b.String(), "hi there") 24 } 25 }