2008-10-01 22:58:53 -04:00
|
|
|
! Copyright (C) 2008 John Benediktsson
|
|
|
|
! See http://factorcode.org/license.txt for BSD license
|
|
|
|
|
2014-11-29 18:54:14 -05:00
|
|
|
USING: kernel tools.test sequences ;
|
2008-10-01 22:58:53 -04:00
|
|
|
|
2014-11-29 18:54:14 -05:00
|
|
|
IN: math.binpack
|
2008-10-01 22:58:53 -04:00
|
|
|
|
2014-11-29 20:34:27 -05:00
|
|
|
{ { V{ } } } [ { } 1 binpack ] unit-test
|
2008-10-01 23:05:08 -04:00
|
|
|
|
2014-11-29 20:34:27 -05:00
|
|
|
{ { V{ 3 } V{ 2 1 } } } [ { 1 2 3 } 2 binpack ] unit-test
|
2008-10-01 22:58:53 -04:00
|
|
|
|
2014-11-29 20:34:27 -05:00
|
|
|
{ { V{ 1000 } V{ 100 60 30 7 } V{ 70 60 40 23 3 } } }
|
2014-11-29 18:54:14 -05:00
|
|
|
[ { 100 23 40 60 1000 30 60 07 70 03 } 3 binpack ] unit-test
|
2008-10-01 22:58:53 -04:00
|
|
|
|
2014-11-29 18:54:14 -05:00
|
|
|
{
|
|
|
|
{
|
2014-11-29 20:34:27 -05:00
|
|
|
V{ "violet" "orange" }
|
|
|
|
V{ "indigo" "green" }
|
|
|
|
V{ "yellow" "blue" "red" }
|
2014-11-29 18:54:14 -05:00
|
|
|
}
|
|
|
|
} [
|
|
|
|
{ "red" "orange" "yellow" "green" "blue" "indigo" "violet" }
|
|
|
|
[ length ] 3 map-binpack
|
|
|
|
] unit-test
|