Skip to content

Commit 3962711

Browse files
download midi file testset
1 parent d0f7017 commit 3962711

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/zmidi-fs-core.Tests/Tests.fs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,26 @@ open Expecto
44
open ZMidi.Internal.ParserMonad
55
open ZMidi.ReadFile
66
open ZMidi.DataTypes
7+
open System.Net
8+
open System.IO.Compression
9+
10+
let downloadFileSet (directory: DirectoryInfo) =
11+
directory.Create()
12+
let archive = Path.Combine(directory.FullName, "maestro-v2.0.0-midi.zip")
13+
let client = new WebClient()
14+
15+
client.DownloadFile(@"https://storage.googleapis.com/magentadata/datasets/maestro/v2.0.0/maestro-v2.0.0-midi.zip", archive)
16+
ZipFile.ExtractToDirectory(archive, Path.Combine(directory.FullName, "maestro-v2.0.0-midi"))
17+
File.Delete archive
718

819
[<Tests>]
920
let tests =
1021
testList "unit" [
1122

1223
test "parse all files" {
1324
let dir = DirectoryInfo(Path.Combine(__SOURCE_DIRECTORY__, "..", "..", "data"))
25+
if not dir.Exists then
26+
downloadFileSet dir
1427
let files =
1528
[|
1629
yield! dir.GetFiles("*.midi", SearchOption.AllDirectories)

0 commit comments

Comments
 (0)