]> gitweb.factorcode.org Git - factor.git/blob - extra/id3/id3-tests.factor
scryfall: make decks better, import from moxfield
[factor.git] / extra / id3 / id3-tests.factor
1 ! Copyright (C) 2009 Tim Wawrzynczak
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: tools.test id3 combinators grouping id3.private
4 sequences math ;
5 IN: id3.tests
6
7 : id3-params ( id3 -- title artist album year comment genre )
8     {
9         [ title ]
10         [ artist ]
11         [ album ]
12         [ year ]
13         [ comment ]
14         [ genre ]
15     } cleave ;
16
17 {
18    "BLAH"
19    "ARTIST"
20    "ALBUM"
21    "2009"
22    "COMMENT"
23    "Bluegrass"
24 } [ "vocab:id3/tests/blah.mp3" mp3>id3 id3-params ] unit-test
25
26 {
27     "Anthem of the Trinity"
28     "Terry Riley"
29     "Shri Camel"
30     f
31     f
32     "Classical"
33 } [ "vocab:id3/tests/blah2.mp3" mp3>id3 id3-params ] unit-test
34
35 {
36    "Stormy Weather"
37    "Frank Sinatra"
38    "Night and Day Frank Sinatra"
39     f
40    "eng, AG# 08E1C12E"
41    "Big Band"
42 } [ "vocab:id3/tests/blah3.mp3" mp3>id3 id3-params ] unit-test
43
44
45 { t }
46 [ 10000 <iota> [ synchsafe>sequence sequence>synchsafe ] map [ < ] monotonic? ] unit-test