aboutsummaryrefslogtreecommitdiff
path: root/test/Sound/MusicDirTrans/Test/Util.hs
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sound/MusicDirTrans/Test/Util.hs')
-rw-r--r--test/Sound/MusicDirTrans/Test/Util.hs89
1 files changed, 89 insertions, 0 deletions
diff --git a/test/Sound/MusicDirTrans/Test/Util.hs b/test/Sound/MusicDirTrans/Test/Util.hs
new file mode 100644
index 0000000..743ce99
--- /dev/null
+++ b/test/Sound/MusicDirTrans/Test/Util.hs
@@ -0,0 +1,89 @@
+{-# LANGUAGE OverloadedStrings #-}
+
+module Sound.MusicDirTrans.Test.Util
+ ( artistPath
+ , artistPathStr
+ , artistPathWithoutYear
+ , metadata
+ , metadataArtistPath
+ , metadataWithoutYear
+ , sampleMetadata
+ , sampleMetadataStr
+ , patterns
+ , origPath
+ , audioTracks
+ )
+where
+
+import Data.Text
+import Sound.HTagLib
+import Sound.MusicDirTrans
+import System.FilePath.Glob
+
+patterns :: [Pattern]
+patterns =
+ [ compile "*.flac"
+ , compile "*.wav"
+ , compile "*.mp3"
+ , compile "*.mp4"
+ , compile "*.asf"
+ , compile "*.aiff"
+ , compile "*.mpc"
+ , compile "*.spx"
+ , compile "*.tt"
+ , compile "*.wv"
+ ]
+
+sampleMetadata :: Metadata
+sampleMetadata = Metadata (mkArtist $ pack "artist")
+ (mkAlbum $ pack "album")
+ (mkYear 2055)
+
+sampleMetadataStr :: String
+sampleMetadataStr = "Metadata {mArtist = Artist \"artist\","
+ ++ " mAlbum = Album \"album\", mYear = Just (Year 2055)}"
+
+metadata :: [Metadata]
+metadata =
+ (Prelude.replicate 5 $ Metadata
+ (mkArtist $ pack "Mono")
+ (mkAlbum $ pack "Requiem for Hell")
+ (mkYear 2019)
+ )
+ ++ [ Metadata
+ (mkArtist $ pack "artist")
+ (mkAlbum $ pack "album")
+ (mkYear 2055)
+ ]
+metadataWithoutYear :: [Metadata]
+metadataWithoutYear =
+ (Prelude.replicate 5 $ Metadata
+ (mkArtist $ pack "Mono")
+ (mkAlbum $ pack "Requiem for Hell")
+ Nothing
+ )
+ ++ [ Metadata
+ (mkArtist $ pack "artist")
+ (mkAlbum $ pack "album")
+ (mkYear 2055)
+ ]
+
+origPath :: FilePath
+origPath = "Mono - Requiem for Hell (2019) JP [FLAC] Vinyl"
+
+artistPath :: ArtistPath
+artistPath = ArtistPath origPath "Mono" "Requiem for Hell (2019)"
+
+artistPathStr :: String
+artistPathStr = "ArtistPath {rootPath = \"Mono - Requiem for Hell (2019) JP [FLAC] Vinyl\""
+ ++ ", parentPath = \"Mono\", childPath = \"Requiem for Hell (2019)\"}"
+
+artistPathWithoutYear :: ArtistPath
+artistPathWithoutYear = ArtistPath origPath "Mono" "Requiem for Hell"
+
+audioTracks :: [AudioTrack]
+audioTracks = [ AudioTrack "audio-samples/sample.flac"
+ , AudioTrack "audio-samples/sample.mp3"]
+
+metadataArtistPath :: ArtistPath
+metadataArtistPath = ArtistPath "audio-samples" "artist" "album (2055)"