github.com/hugelgupf/u-root@v0.0.0-20191023214958-4807c632154c/pkg/mount/fs_linux_test.go (about) 1 // Copyright 2015-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 mount 6 7 import ( 8 "fmt" 9 "testing" 10 ) 11 12 func TestFindFileSystem(t *testing.T) { 13 for _, tt := range []struct { 14 name string 15 err string 16 }{ 17 {"rootfs", "<nil>"}, 18 {"bogusfs", "bogusfs not found"}, 19 } { 20 t.Run(tt.name, func(t *testing.T) { 21 err := FindFileSystem(tt.name) 22 // There has to be a better way to do this. 23 if fmt.Sprintf("%v", err) != tt.err { 24 t.Errorf("%s: got %v, want %v", tt.name, err, tt.err) 25 } 26 }) 27 } 28 }