forget-vocab and forget-source now call with-compilation-unit

db4
Slava Pestov 2007-12-24 17:32:41 -05:00
parent 02b509a1d4
commit 41fc4ea84e
13 changed files with 57 additions and 31 deletions

2
core/classes/classes-tests.factor Normal file → Executable file
View File

@ -137,7 +137,7 @@ INSTANCE: integer mx1
[ mx1 ] [ array integer class-or ] unit-test
\ mx1 forget
[ \ mx1 forget ] with-compilation-unit
[ f ] [ array integer class-or mx1 = ] unit-test

View File

@ -32,7 +32,7 @@ parse-hook get [
[ f ] [ \ bar changed-words get key? ] unit-test
[ ] [ \ bar [ 1 2 3 ] define-compound ] unit-test
[ t ] [ \ bar changed-words get key? ] unit-test
[ ] [ \ bar forget ] unit-test
[ ] [ [ \ bar forget ] with-compilation-unit ] unit-test
[ f ] [ \ bar changed-words get key? ] unit-test
: xy ;

0
core/cpu/x86/bootstrap.factor Normal file → Executable file
View File

15
core/definitions/definitions-tests.factor Normal file → Executable file
View File

@ -11,7 +11,11 @@ generic-1 T{ combination-1 } define-generic
[ ] <method> object \ generic-1 define-method
[ ] [ { combination-1 { object generic-1 } } forget-all ] unit-test
[ ] [
[
{ combination-1 { object generic-1 } } forget-all
] with-compilation-unit
] unit-test
GENERIC: some-generic
@ -34,6 +38,11 @@ M: some-class some-generic ;
TUPLE: another-class some-generic ;
[ ] [
{ some-generic some-class { another-class some-generic } }
forget-all
[
{
some-generic
some-class
{ another-class some-generic }
} forget-all
] with-compilation-unit
] unit-test

8
core/listener/listener-tests.factor Normal file → Executable file
View File

@ -26,11 +26,15 @@ IN: temporary
] unit-test
] with-scope
[ ] [ "vocabs.loader.test.c" forget-vocab ] unit-test
[ ] [
"vocabs.loader.test.c" forget-vocab
] unit-test
[
"USE: vocabs.loader.test.c" <string-reader>
parse-interactive
] unit-test-fails
[ ] [ "vocabs.loader.test.c" forget-vocab ] unit-test
[ ] [
"vocabs.loader.test.c" forget-vocab
] unit-test

View File

@ -74,10 +74,12 @@ uses definitions ;
M: pathname where pathname-string 1 2array ;
: forget-source ( path -- )
dup source-file
dup unxref-source
source-file-definitions [ keys forget-all ] each
source-files get delete-at ;
[
dup source-file
dup unxref-source
source-file-definitions [ keys forget-all ] each
source-files get delete-at
] with-compilation-unit ;
M: pathname forget pathname-string forget-source ;

18
core/tuples/tuples-tests.factor Normal file → Executable file
View File

@ -120,11 +120,13 @@ TUPLE: yo-momma ;
[ f ] [ \ <yo-momma> generic? ] unit-test
! Test forget
[ t ] [ \ yo-momma class? ] unit-test
[ ] [ \ yo-momma forget ] unit-test
[ f ] [ \ yo-momma typemap get values memq? ] unit-test
[
[ t ] [ \ yo-momma class? ] unit-test
[ ] [ \ yo-momma forget ] unit-test
[ f ] [ \ yo-momma typemap get values memq? ] unit-test
[ f ] [ \ yo-momma interned? ] unit-test
[ f ] [ \ yo-momma interned? ] unit-test
] with-compilation-unit
TUPLE: loc-recording ;
@ -140,9 +142,11 @@ M: forget-robustness forget-robustness-generic ;
M: integer forget-robustness-generic ;
[ ] [ \ forget-robustness-generic forget ] unit-test
[ ] [ \ forget-robustness forget ] unit-test
[ ] [ { forget-robustness forget-robustness-generic } forget ] unit-test
[
[ ] [ \ forget-robustness-generic forget ] unit-test
[ ] [ \ forget-robustness forget ] unit-test
[ ] [ { forget-robustness forget-robustness-generic } forget ] unit-test
] with-compilation-unit
! rapido found this one
GENERIC# m1 0 ( s n -- n )

16
core/vocabs/loader/loader-tests.factor Normal file → Executable file
View File

@ -6,7 +6,9 @@ parser source-files words assocs tuples definitions
debugger ;
! This vocab should not exist, but just in case...
[ ] [ "vocabs.loader.test" forget-vocab ] unit-test
[ ] [
"vocabs.loader.test" forget-vocab
] unit-test
[ T{ vocab-link f "vocabs.loader.test" } ]
[ "vocabs.loader.test" f >vocab-link ] unit-test
@ -78,12 +80,12 @@ IN: temporary
0 "count-me" set-global
[ ] [ "vocabs.loader.test.b" forget-vocab ] unit-test
[ ] [
"vocabs.loader.test.b" forget-vocab
] unit-test
[ ] [
"vocabs.loader.test.b" vocab-files [
forget-source
] each
"vocabs.loader.test.b" vocab-files [ forget-source ] each
] unit-test
[ "vocabs.loader.test.b" require ] unit-test-fails
@ -101,9 +103,7 @@ IN: temporary
[ t ] [ "fred" "vocabs.loader.test.b" lookup compound? ] unit-test
[ ] [
"vocabs.loader.test.b" vocab-files [
forget-source
] each
"vocabs.loader.test.b" vocab-files [ forget-source ] each
] unit-test
[ ] [ "vocabs.loader.test.b" refresh ] unit-test

6
core/vocabs/vocabs.factor Normal file → Executable file
View File

@ -76,8 +76,10 @@ SYMBOL: load-vocab-hook
[ ] subset ;
: forget-vocab ( vocab -- )
dup vocab-words values forget-all
vocab-name dictionary get delete-at ;
[
dup vocab-words values forget-all
vocab-name dictionary get delete-at
] with-compilation-unit ;
: child-vocab? ( prefix name -- ? )
2dup = pick empty? or

4
extra/help/crossref/crossref-tests.factor Normal file → Executable file
View File

@ -18,7 +18,9 @@ io.streams.string continuations debugger ;
[ "foo" ] [ "foo" "temporary" lookup article-parent ] unit-test
[ ] [ "foo" "temporary" lookup forget ] unit-test
[ ] [
[ "foo" "temporary" lookup forget ] with-compilation-unit
] unit-test
[ ] [
"IN: temporary USING: help.syntax help.markup ; : bar ; HELP: bar \"bar is great\" ; ARTICLE: \"bar\" \"Bar\" { $subsection bar } ;" eval

0
extra/tools/test/test.factor Normal file → Executable file
View File

View File

@ -74,7 +74,10 @@ UNION: definition word method-spec link vocab vocab-link ;
{ +listener+ t }
} define-operation
[ definition? ] \ forget H{ } define-operation
: com-forget ( defspec -- )
[ forget ] with-compilation-unit ;
[ definition? ] \ com-forget H{ } define-operation
! Words
[ word? ] \ insert-word H{

2
extra/ui/traverse/traverse-tests.factor Normal file → Executable file
View File

@ -62,4 +62,4 @@ M: object (flatten-tree) , ;
{ 0 1 } { 2 0 1 } { { "a" "b" "c" "d" } { "e" "f" "g" } { { "h" "i" } "j" } } gadgets-in-range
] unit-test
{ array gadget-children } forget
[ { array gadget-children } forget ] with-compilation-unit