2016-11-26 06:58:09 -05:00
|
|
|
USING: compiler.crossref fry kernel namespaces sequences
|
|
|
|
stack-checker.dependencies tools.test vocabs words ;
|
2010-02-19 18:01:47 -05:00
|
|
|
IN: compiler.crossref.tests
|
|
|
|
|
|
|
|
! Dependencies of all words should always be satisfied unless we're
|
|
|
|
! in the middle of recompiling something
|
2015-07-03 12:39:59 -04:00
|
|
|
{ { } } [
|
2010-02-19 18:01:47 -05:00
|
|
|
all-words dup [ subwords ] map concat append
|
2015-05-12 21:50:34 -04:00
|
|
|
H{ } clone '[ _ dependencies-satisfied? ] reject
|
2010-02-19 18:01:47 -05:00
|
|
|
] unit-test
|
2016-11-26 06:58:09 -05:00
|
|
|
|
|
|
|
: setup-crossref ( -- assoc )
|
|
|
|
H{
|
|
|
|
{
|
|
|
|
10
|
|
|
|
H{
|
2016-11-26 09:44:09 -05:00
|
|
|
{ 20 +definition+ }
|
|
|
|
{ 30 +conditional+ }
|
|
|
|
{ 40 +effect+ }
|
2016-11-26 06:58:09 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} clone ;
|
|
|
|
|
|
|
|
! dependencies-of
|
|
|
|
{
|
2016-11-26 09:44:09 -05:00
|
|
|
H{ { 20 +definition+ } }
|
2016-11-26 06:58:09 -05:00
|
|
|
} [
|
|
|
|
setup-crossref compiled-crossref [
|
2016-11-26 09:44:09 -05:00
|
|
|
10 +definition+ dependencies-of
|
2016-11-26 06:58:09 -05:00
|
|
|
] with-variable
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
{
|
2016-11-26 09:44:09 -05:00
|
|
|
H{ { 20 +definition+ } { 30 +conditional+ } }
|
2016-11-26 06:58:09 -05:00
|
|
|
} [
|
|
|
|
setup-crossref compiled-crossref [
|
2016-11-26 09:44:09 -05:00
|
|
|
10 +conditional+ dependencies-of
|
2016-11-26 06:58:09 -05:00
|
|
|
] with-variable
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
! join-dependencies
|
|
|
|
{
|
|
|
|
H{
|
2016-11-26 09:44:09 -05:00
|
|
|
{ 1 +effect+ }
|
|
|
|
{ 2 +effect+ }
|
|
|
|
{ 3 +conditional+ }
|
|
|
|
{ 4 +conditional+ }
|
|
|
|
{ 5 +definition+ }
|
|
|
|
{ 6 +definition+ }
|
2016-11-26 06:58:09 -05:00
|
|
|
}
|
|
|
|
} [
|
|
|
|
{ 1 2 } { 3 4 } { 5 6 } join-dependencies
|
|
|
|
] unit-test
|