factor/library/test/words.factor

63 lines
1.3 KiB
Factor
Raw Normal View History

2004-08-19 19:36:28 -04:00
IN: scratchpad
2004-08-26 22:21:17 -04:00
USE: math
2004-08-19 19:36:28 -04:00
USE: test
USE: words
2004-09-28 00:24:36 -04:00
USE: namespaces
USE: lists
2004-10-19 12:32:54 -04:00
USE: kernel
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 ] [
\ plist-test t "sample-property" set-word-property
\ plist-test "sample-property" word-property
] unit-test
[ f ] [
\ plist-test f "sample-property" set-word-property
\ plist-test "sample-property" word-property
] 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
"create-test" "scratchpad" create { 1 2 } "testing" set-word-property
[ { 1 2 } ] [
"create-test" [ "scratchpad" ] search "testing" word-property
] 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
[ t ] [ vocabs list? ] unit-test
[ t ] [ vocabs [ words [ word? ] all? ] all? ] unit-test
[ f ] [ gensym gensym = ] unit-test
[ 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
: 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