]> gitweb.factorcode.org Git - factor.git/blob - extra/math/binpack/binpack-tests.factor
d28eff031fc53e2bf8aca6d06b520c03b7e213a9
[factor.git] / extra / math / binpack / binpack-tests.factor
1 ! Copyright (C) 2008 John Benediktsson
2 ! See http://factorcode.org/license.txt for BSD license
3
4 USING: kernel tools.test sequences ;
5
6 IN: math.binpack
7
8 { { V{ } } } [ { } 1 binpack ] unit-test
9
10 { { V{ 3 } V{ 2 1 } } } [ { 1 2 3 } 2 binpack ] unit-test
11
12 { { V{ 1000 } V{ 100 60 30 7 } V{ 70 60 40 23 3 } } }
13 [ { 100 23 40 60 1000 30 60 07 70 03 } 3 binpack ] unit-test
14
15 {
16     {
17         V{ "violet" "orange" }
18         V{ "indigo" "green" }
19         V{ "yellow" "blue" "red" }
20     }
21 } [
22     { "red" "orange" "yellow" "green" "blue" "indigo" "violet" }
23     [ length ] 3 map-binpack
24 ] unit-test