@@ -7,15 +7,15 @@ import (
77 "github.com/viktomas/godu/core"
88)
99
10- func TestPrintEmptyMarkedFiles (t * testing.T ) {
10+ func TestFilesAsSliceEmptyMap (t * testing.T ) {
1111 marked := make (map [* core.File ]struct {})
12- result := QuoteMarkedFiles (marked )
12+ result := FilesAsSlice (marked )
1313 if len (result ) > 0 {
14- t .Errorf ("Expected empty output from PrintMarkedFiles , got '%v'" , result )
14+ t .Errorf ("Expected empty output, got '%v'" , result )
1515 }
1616}
1717
18- func TestPrintMarkedFiles (t * testing.T ) {
18+ func TestFilesAsSlice (t * testing.T ) {
1919 root := core .NewTestFolder ("." ,
2020 core .NewTestFile ("'single''quotes'" , 0 ),
2121 core .NewTestFolder ("d1" ,
@@ -33,9 +33,10 @@ func TestPrintMarkedFiles(t *testing.T) {
3333 marked [core .FindTestFile (root , "f1" )] = struct {}{}
3434 marked [core .FindTestFile (root , "f2" )] = struct {}{}
3535 marked [core .FindTestFile (root , "'single''quotes'" )] = struct {}{}
36- result := QuoteMarkedFiles (marked )
37- expected := []string {"'\\ 'single\\ '\\ 'quotes\\ ''" , "'d1/d3/f2'" , "'d1/f1'" , "'d1'" , "'d2'" }
38- if ! reflect .DeepEqual (result , expected ) {
39- t .Errorf ("Expected '%v' from PrintMarkedFiles, got '%v'" , expected , result )
36+
37+ want := []string {"'single''quotes'" , "d1/d3/f2" , "d1/f1" , "d1" , "d2" }
38+ got := FilesAsSlice (marked )
39+ if ! reflect .DeepEqual (want , got ) {
40+ t .Errorf ("Expected '%v', got '%v'" , want , got )
4041 }
4142}
0 commit comments