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