|
|
|
@ -14,12 +14,34 @@ func ExampleFile() {
|
|
|
|
|
os.Chdir("testdata/file")
|
|
|
|
|
defer os.Chdir("../..")
|
|
|
|
|
fmt.Println(comp.File(nil))
|
|
|
|
|
fmt.Println(comp.File(nil, "b"))
|
|
|
|
|
fmt.Println(comp.File(nil, "blah"))
|
|
|
|
|
fmt.Println(comp.File(nil, "blah/"))
|
|
|
|
|
fmt.Println(comp.File(nil, ""))
|
|
|
|
|
fmt.Println(comp.File(nil, "fo"))
|
|
|
|
|
fmt.Println(comp.File(nil, "foo"))
|
|
|
|
|
fmt.Println(comp.File(nil, "bar/fo"))
|
|
|
|
|
fmt.Println(comp.File(nil, "bar/foo"))
|
|
|
|
|
fmt.Println(comp.File(nil, "com"))
|
|
|
|
|
//fmt.Println(comp.File(nil, "come/"))
|
|
|
|
|
//fmt.Println(comp.File(nil, "b"))
|
|
|
|
|
//fmt.Println(comp.File(nil, "blah"))
|
|
|
|
|
//fmt.Println(comp.File(nil, "blah/"))
|
|
|
|
|
//fmt.Println(comp.File(nil, "blah/f"))
|
|
|
|
|
//fmt.Println(comp.File(nil, "blah/file1"))
|
|
|
|
|
|
|
|
|
|
//Output:
|
|
|
|
|
// [bar/ blah/ come/ foo/ other/]
|
|
|
|
|
// [bar/ blah/]
|
|
|
|
|
// [blah/]
|
|
|
|
|
// [dir1/ dir2/ file1 file2]
|
|
|
|
|
// [bar/ blah/ come/ foo/ foo.go other/]
|
|
|
|
|
// [bar/ blah/ come/ foo/ foo.go other/]
|
|
|
|
|
// [foo/ foo.go]
|
|
|
|
|
// [foo/ foo.go]
|
|
|
|
|
// [bar/foo/ bar/foo.go]
|
|
|
|
|
// [bar/foo/ bar/foo.go]
|
|
|
|
|
// [come/one]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// [come/one]
|
|
|
|
|
// [bar/ blah/]
|
|
|
|
|
// [blah/dir1/ blah/dir2/ blah/file1 blah/file2]
|
|
|
|
|
// [blah/dir1/ blah/dir2/ blah/file1 blah/file2]
|
|
|
|
|
// [blah/file1 blah/file2]
|
|
|
|
|
// [blah/file1]
|
|
|
|
|
// [foo/ foo.go]
|
|
|
|
|
// [foo/ foo.go]
|
|
|
|
|