PageRenderTime 14ms CodeModel.GetById 2ms app.highlight 10ms RepoModel.GetById 1ms app.codeStats 0ms

/extra/sequences/inserters/inserters-tests.factor

http://github.com/abeaumont/factor
Unknown | 45 lines | 36 code | 9 blank | 0 comment | 0 complexity | 338b89c5320f76e2c1dd795b1dfd1b4d MD5 | raw file
 1! (c)2010 Joe Groff bsd license
 2USING: assocs kernel sequences sequences.inserters tools.test
 3unicode.case ;
 4IN: sequences.inserters.tests
 5
 6[ V{ 1 2 "Three" "Four" "Five" } ] [
 7    { "three" "four" "five" }
 8    [ >title ] V{ 1 2 } clone <appender> map-as
 9] unit-test
10
11[ t ] [
12    { "three" "four" "five" }
13    [ >title ] V{ 1 2 } clone [ <appender> map-as ] keep eq?
14] unit-test
15
16[ V{ 1 2 "Three" "Four" "Five" } ] [
17    { { "Th" "ree" } { "Fo" "ur" } { "Fi" "ve" } }
18    [ append ] V{ 1 2 } clone <appender> assoc>map
19] unit-test
20
21[ t ] [
22    { { "Th" "ree" } { "Fo" "ur" } { "Fi" "ve" } }
23    [ append ] V{ 1 2 } clone [ <appender> assoc>map ] keep eq?
24] unit-test
25
26[ V{ "Three" "Four" "Five" } ] [
27    { "three" "four" "five" }
28    [ >title ] V{ 1 2 } clone <replacer> map-as
29] unit-test
30
31[ t ] [
32    { "three" "four" "five" }
33    [ >title ] V{ 1 2 } clone [ <replacer> map-as ] keep eq?
34] unit-test
35
36[ V{ "Three" "Four" "Five" } ] [
37    { { "Th" "ree" } { "Fo" "ur" } { "Fi" "ve" } }
38    [ append ] V{ 1 2 } clone <replacer> assoc>map
39] unit-test
40
41[ t ] [
42    { { "Th" "ree" } { "Fo" "ur" } { "Fi" "ve" } }
43    [ append ] V{ 1 2 } clone [ <replacer> assoc>map ] keep eq?
44] unit-test
45