diff --git a/api/dataimport/sdfToRSI/scanSDF_test.go b/api/dataimport/sdfToRSI/scanSDF_test.go index 10f8be18..748e6cdd 100644 --- a/api/dataimport/sdfToRSI/scanSDF_test.go +++ b/api/dataimport/sdfToRSI/scanSDF_test.go @@ -3,11 +3,11 @@ package sdfToRSI import "fmt" func Example_scanSDF() { - ensureSDFRawExists() - refs, err := scanSDF("./test-data/BadPath.txt") fmt.Printf("%v|%v\n", len(refs), err != nil) + ensureSDFRawExists() + refs, err = scanSDF("./test-data/sdf_raw.txt") fmt.Printf("err: %v\n", err) for _, ref := range refs { diff --git a/api/dataimport/sdfToRSI/sdfToRSI_test.go b/api/dataimport/sdfToRSI/sdfToRSI_test.go index 3e5a193e..df9644dd 100644 --- a/api/dataimport/sdfToRSI/sdfToRSI_test.go +++ b/api/dataimport/sdfToRSI/sdfToRSI_test.go @@ -6,17 +6,22 @@ import ( "io" "log" "os" + "path/filepath" ) func Example_ConvertSDFtoRSI() { ensureSDFRawExists() - fmt.Printf("Mkdir output: %v\n", os.MkdirAll("./output", 0644)) - files, rtts, err := ConvertSDFtoRSIs("./test-data/sdf_raw.txt", "./output/") + fmt.Printf("mkdir worked: %v\n", os.MkdirAll("./output", 0777) == nil) + wd, err := os.Getwd() + fmt.Printf("Getwd: %v\n", err == nil) + p := filepath.Join(wd, "output") + files, rtts, err := ConvertSDFtoRSIs("./test-data/sdf_raw.txt", p) fmt.Printf("%v, %v: %v\n", files, rtts, err) // Output: - // Mkdir output: + // mkdir worked: true + // Getwd: true // [RSI-208536069.csv RSI-208601602.csv], [208536069 208601602]: } @@ -51,13 +56,4 @@ func ensureSDFRawExists() { } } } - - err = os.MkdirAll("./output", 0644) - fmt.Printf("mkdir worked: %v\n", err == nil) - files, rtts, err := ConvertSDFtoRSIs("./test-data/sdf_raw.txt", "./output/") - fmt.Printf("%v, %v: %v\n", files, rtts, err) - - // Output: - // mkdir worked: true - // [RSI-208536069.csv RSI-208601602.csv], [208536069 208601602]: }