2005-03-28 23:45:13 -05:00
|
|
|
IN: temporary
|
2005-10-04 03:16:50 -04:00
|
|
|
USING: generic hashtables kernel lists math namespaces sequences
|
|
|
|
|
test words ;
|
2004-08-19 19:36:28 -04:00
|
|
|
|
|
|
|
|
[ 4 ] [
|
|
|
|
|
"poo" "scratchpad" create [ 2 2 + ] define-compound
|
|
|
|
|
"poo" [ "scratchpad" ] search execute
|
|
|
|
|
] unit-test
|
2004-09-28 00:24:36 -04:00
|
|
|
|
2005-01-28 23:55:22 -05:00
|
|
|
[ t ] [ t vocabs [ words [ word? and ] each ] each ] unit-test
|
2004-09-28 00:24:36 -04:00
|
|
|
|
2004-10-16 21:55:13 -04:00
|
|
|
DEFER: plist-test
|
|
|
|
|
|
|
|
|
|
[ t ] [
|
2005-03-05 14:45:23 -05:00
|
|
|
\ plist-test t "sample-property" set-word-prop
|
|
|
|
|
\ plist-test "sample-property" word-prop
|
2004-10-16 21:55:13 -04:00
|
|
|
] unit-test
|
|
|
|
|
|
|
|
|
|
[ f ] [
|
2005-03-05 14:45:23 -05:00
|
|
|
\ plist-test f "sample-property" set-word-prop
|
|
|
|
|
\ plist-test "sample-property" word-prop
|
2004-10-16 21:55:13 -04:00
|
|
|
] unit-test
|
2004-09-28 00:24:36 -04:00
|
|
|
|
2005-01-28 23:55:22 -05:00
|
|
|
[ f ] [ 5 compound? ] unit-test
|
2004-10-17 16:04:49 -04:00
|
|
|
|
2005-03-05 14:45:23 -05:00
|
|
|
"create-test" "scratchpad" create { 1 2 } "testing" set-word-prop
|
2004-10-17 16:04:49 -04:00
|
|
|
[ { 1 2 } ] [
|
2005-03-05 14:45:23 -05:00
|
|
|
"create-test" [ "scratchpad" ] search "testing" word-prop
|
2004-10-17 16:04:49 -04:00
|
|
|
] unit-test
|
2004-10-19 12:32:54 -04:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
[ t ] [ \ car "car" [ "lists" ] search = ] unit-test
|
|
|
|
|
|
|
|
|
|
"test-scope" "scratchpad" create drop
|
|
|
|
|
] with-scope
|
|
|
|
|
|
|
|
|
|
[ "test-scope" ] [
|
|
|
|
|
"test-scope" [ "scratchpad" ] search word-name
|
|
|
|
|
] unit-test
|
2004-11-20 16:57:01 -05:00
|
|
|
|
|
|
|
|
[ t ] [ vocabs list? ] unit-test
|
|
|
|
|
[ t ] [ vocabs [ words [ word? ] all? ] all? ] unit-test
|
2004-12-04 15:10:46 -05:00
|
|
|
|
|
|
|
|
[ f ] [ gensym gensym = ] unit-test
|
2004-12-12 23:49:44 -05:00
|
|
|
|
|
|
|
|
[ f ] [ 123 compound? ] unit-test
|
|
|
|
|
|
|
|
|
|
: colon-def ;
|
|
|
|
|
[ t ] [ \ colon-def compound? ] unit-test
|
|
|
|
|
|
|
|
|
|
SYMBOL: a-symbol
|
|
|
|
|
[ f ] [ \ a-symbol compound? ] unit-test
|
|
|
|
|
[ t ] [ \ a-symbol symbol? ] unit-test
|
2004-12-13 15:37:50 -05:00
|
|
|
|
2005-03-05 14:45:23 -05:00
|
|
|
! See if redefining a generic as a colon def clears some
|
|
|
|
|
! word props.
|
|
|
|
|
GENERIC: testing
|
|
|
|
|
: testing ;
|
|
|
|
|
|
|
|
|
|
[ f ] [ \ testing generic? ] unit-test
|
|
|
|
|
|
2005-07-19 04:23:33 -04:00
|
|
|
[ f ] [ gensym interned? ] unit-test
|
|
|
|
|
|
|
|
|
|
: forgotten ;
|
|
|
|
|
: another-forgotten ;
|
|
|
|
|
|
|
|
|
|
[ f ] [ \ forgotten interned? ] unit-test
|
|
|
|
|
|
|
|
|
|
FORGET: forgotten
|
|
|
|
|
|
|
|
|
|
[ f ] [ \ another-forgotten interned? ] unit-test
|
|
|
|
|
|
|
|
|
|
FORGET: another-forgotten
|
|
|
|
|
: another-forgotten ;
|
|
|
|
|
|
|
|
|
|
[ t ] [ \ car interned? ] unit-test
|
|
|
|
|
|
2005-10-04 03:16:50 -04:00
|
|
|
! I forgot remove-crossref calls!
|
|
|
|
|
: fee ;
|
|
|
|
|
: foe fee ;
|
|
|
|
|
: fie foe ;
|
|
|
|
|
|
|
|
|
|
[ 0 ] [ \ fee crossref get hash hash-size ] unit-test
|
|
|
|
|
[ t ] [ \ foe crossref get hash not ] unit-test
|
|
|
|
|
|
|
|
|
|
FORGET: foe
|
|
|
|
|
|
2005-03-05 14:45:23 -05:00
|
|
|
! This has to be the last test in the file.
|
2004-12-13 15:37:50 -05:00
|
|
|
: test-last ( -- ) ;
|
|
|
|
|
word word-name "last-word-test" set
|
|
|
|
|
|
2005-01-28 23:55:22 -05:00
|
|
|
[ "test-last" ] [ "last-word-test" get ] unit-test
|