Skip to content

Commit

Permalink
Merge pull request #351 from pixlise/feature/archive-optimiser-tool
Browse files Browse the repository at this point in the history
Feature/archive optimiser tool
  • Loading branch information
pnemere authored Nov 11, 2024
2 parents f1476b9 + 67f1881 commit 47cc3db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
4 changes: 2 additions & 2 deletions api/dataimport/sdfToRSI/scanSDF_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
20 changes: 8 additions & 12 deletions api/dataimport/sdfToRSI/sdfToRSI_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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: <nil>
// mkdir worked: true
// Getwd: true
// [RSI-208536069.csv RSI-208601602.csv], [208536069 208601602]: <nil>
}

Expand Down Expand Up @@ -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]: <nil>
}

0 comments on commit 47cc3db

Please sign in to comment.