File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -463,6 +463,35 @@ func (suite *dirTestSuite) TestDirList() {
463463 suite .dirTestCleanup ([]string {testDir })
464464}
465465
466+ // # List directory with dot entries
467+ func (suite * dirTestSuite ) TestDirListShowsDots () {
468+ if runtime .GOOS == "windows" {
469+ fmt .Println ("Skipping TestDirListShowsDots on Windows" )
470+ return
471+ }
472+ cmd := exec .Command ("ls" , "-al" , suite .testPath )
473+ cliOut , err := cmd .Output ()
474+ suite .NoError (err )
475+ lines := strings .Split (string (cliOut ), "\n " )
476+ foundDot := false
477+ foundDotDot := false
478+ for _ , line := range lines {
479+ fields := strings .Fields (line )
480+ if len (fields ) == 0 {
481+ continue
482+ }
483+ name := fields [len (fields )- 1 ]
484+ switch name {
485+ case "." :
486+ foundDot = true
487+ case ".." :
488+ foundDotDot = true
489+ }
490+ }
491+ suite .True (foundDot , "expected '.' to be listed in ls -al output" )
492+ suite .True (foundDotDot , "expected '..' to be listed in ls -al output" )
493+ }
494+
466495// // # List directory recursively
467496// func (suite *dirTestSuite) TestDirListRecursive() {
468497// testDir := filepath.Join(suite.testPath, "bigTestDir")
You can’t perform that action at this time.
0 commit comments