files_test.go 311 B

123456789101112131415161718192021
  1. package movies
  2. import (
  3. "fmt"
  4. "os"
  5. "testing"
  6. )
  7. func TestFileSource(t *testing.T) {
  8. fs := &FileSource{ID: "dummy fs"}
  9. if err := fs.Scan(os.Getenv("FILE_ROOT")); err != nil {
  10. t.Fatal(err)
  11. }
  12. fmt.Println(len(fs.Files))
  13. for _, res := range fs.Search("game of thrones s02e06") {
  14. fmt.Println(res)
  15. }
  16. }