]> gitweb.factorcode.org Git - factor.git/blob - extra/subrip-subtitles/subrip-subtitles-tests.factor
ui.tools.listener.completion: change history completion popup to preserve newlines
[factor.git] / extra / subrip-subtitles / subrip-subtitles-tests.factor
1 ! Copyright (C) 2014 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: calendar subrip-subtitles tools.test ;
4
5 {
6     {
7         T{ srt-chunk
8             { id 1 }
9             { begin-time T{ duration { second 10.5 } } }
10             { end-time T{ duration { second 13.0 } } }
11             { text "Elephant's Dream" }
12         }
13         T{ srt-chunk
14             { id 2 }
15             { begin-time T{ duration { second 15.0 } } }
16             { end-time T{ duration { second 18.0 } } }
17             { text "At the left we can see..." }
18         }
19     }
20 } [
21 "1
22 00:00:10,500 --> 00:00:13,000
23 Elephant's Dream
24
25 2
26 00:00:15,000 --> 00:00:18,000
27 At the left we can see..."
28     parse-srt-string
29 ] unit-test
30
31 {
32     {
33         T{ srt-chunk
34             { id 1 }
35             { begin-time T{ duration { second 10.5 } } }
36             { end-time T{ duration { second 13.0 } } }
37             { rect { { 63 43 } { 223 58 } } }
38             { text "<i>Elephant's Dream</i>" }
39         }
40         T{ srt-chunk
41             { id 2 }
42             { begin-time T{ duration { second 15.0 } } }
43             { end-time T{ duration { second 18.0 } } }
44             { rect { { 53 438 } { 303 453 } } }
45             { text
46                 "<font color=\"cyan\">At the left we can see...</font>"
47             }
48         }
49     }
50 } [
51 "1
52 00:00:10,500 --> 00:00:13,000  X1:63 X2:223 Y1:43 Y2:58
53 <i>Elephant's Dream</i>
54
55 2
56 00:00:15,000 --> 00:00:18,000  X1:53 X2:303 Y1:438 Y2:453
57 <font color=\"cyan\">At the left we can see...</font>"
58     parse-srt-string
59 ] unit-test