1 // Copyright 2017 syzkaller project authors. All rights reserved. 2 // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. 3 4 package osutil 5 6 import ( 7 "os" 8 "testing" 9 ) 10 11 func TestIsExist(t *testing.T) { 12 if f := os.Args[0]; !IsExist(f) { 13 t.Fatalf("executable %v does not exist", f) 14 } 15 if f := os.Args[0] + "-foo-bar-buz"; IsExist(f) { 16 t.Fatalf("file %v exists", f) 17 } 18 } 19