]> gitweb.factorcode.org Git - factor.git/commitdiff
Fixing unit tests for syntax change
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 23 Mar 2009 05:34:02 +0000 (00:34 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 23 Mar 2009 05:34:02 +0000 (00:34 -0500)
56 files changed:
basis/bit-vectors/bit-vectors-tests.factor
basis/byte-vectors/byte-vectors-tests.factor
basis/calendar/calendar-tests.factor
basis/cocoa/cocoa-tests.factor
basis/db/tuples/tuples-tests.factor
basis/delegate/delegate-tests.factor
basis/fry/fry-tests.factor
basis/furnace/actions/actions-tests.factor
basis/furnace/furnace-tests.factor
basis/furnace/sessions/sessions-tests.factor
basis/hash2/hash2-tests.factor
basis/help/crossref/crossref-tests.factor
basis/help/definitions/definitions-tests.factor
basis/help/markup/markup-tests.factor
basis/html/templates/chloe/chloe-tests.factor
basis/http/http-tests.factor
basis/io/backend/unix/unix-tests.factor
basis/io/encodings/utf16n/utf16n-tests.factor
basis/io/streams/duplex/duplex-tests.factor
basis/listener/listener-tests.factor
basis/locals/locals-tests.factor
basis/macros/macros-tests.factor
basis/macros/macros.factor
basis/models/models-tests.factor
basis/models/range/range-tests.factor
basis/persistent/heaps/heaps-tests.factor
basis/prettyprint/prettyprint-tests.factor
basis/serialize/serialize-tests.factor
basis/tools/annotations/annotations-tests.factor
basis/tools/crossref/crossref-tests.factor
basis/tools/walker/walker-tests.factor
basis/ui/gadgets/buttons/buttons-tests.factor
basis/ui/gadgets/gadgets-tests.factor
basis/ui/gadgets/panes/panes-tests.factor
basis/ui/operations/operations-tests.factor
basis/ui/tools/listener/listener-tests.factor
basis/urls/urls-tests.factor
core/classes/singleton/singleton-tests.factor
core/combinators/combinators-tests.factor
core/continuations/continuations-tests.factor
core/destructors/destructors-tests.factor
core/io/test/no-trailing-eol.factor
core/kernel/kernel-tests.factor
core/parser/parser-tests.factor
core/vocabs/loader/loader-tests.factor
core/vocabs/loader/test/d/d.factor
extra/advice/advice-tests.factor
extra/descriptive/descriptive.factor
extra/infix/infix-tests.factor
extra/lint/lint-tests.factor
extra/math/analysis/analysis-tests.factor
extra/multi-methods/tests/canonicalize.factor
extra/multi-methods/tests/legacy.factor
extra/sequences/n-based/n-based-tests.factor
extra/svg/svg-tests.factor
extra/units/units-tests.factor

index 31327999e73fceccb6ecd6c38ee9ff036cfaf3d2..41efdbd0d22b491fda2eca30d89b61a5381deba0 100644 (file)
@@ -3,7 +3,7 @@ USING: tools.test bit-vectors vectors sequences kernel math ;
 \r
 [ 0 ] [ 123 <bit-vector> length ] unit-test\r
 \r
-: do-it\r
+: do-it ( seq -- )\r
     1234 swap [ [ even? ] dip push ] curry each ;\r
 \r
 [ t ] [\r
index 9a100d9795a36442696f1638c90574c25c0aa32e..bd7510c95f632cb8b90e77702429dbc7626815a0 100644 (file)
@@ -4,7 +4,7 @@ prettyprint ;
 \r
 [ 0 ] [ 123 <byte-vector> length ] unit-test\r
 \r
-: do-it\r
+: do-it ( seq -- seq )\r
     123 [ over push ] each ;\r
 \r
 [ t ] [\r
index 00d5730745728979aa94b2e49007e9e0f7327e07..b6d8e74072edb7ab0bdd7bbdd7d773150915cc11 100644 (file)
@@ -148,7 +148,7 @@ IN: calendar.tests
 [ t ] [ 123456789000000 [ micros>timestamp timestamp>micros ] keep = ] unit-test
 [ t ] [ 123456789123456000 [ micros>timestamp timestamp>micros ] keep = ] unit-test
 
-: checktime+ now dup clone [ rot time+ drop ] keep = ;
+: checktime+ ( duration -- ? ) now dup clone [ rot time+ drop ] keep = ;
 
 [ t ] [ 5 seconds checktime+ ] unit-test
 
index d77435a8ad21263353f34428b76b549d202dfc38..4b5af2e39d3ce533aa8b24b0a7512df388b15edc 100644 (file)
@@ -13,7 +13,7 @@ CLASS: {
     [ gc "x" set 2drop ]
 } ;
 
-: test-foo
+: test-foo ( -- )
     Foo -> alloc -> init
     dup 1.0 2.0 101.0 102.0 <CGRect> -> foo:
     -> release ;
index af77ce6ac1ced820de85ac2f3c378835d5534a87..50d7f044d169336e111d806a7f929cfbfebcd3df 100644 (file)
@@ -285,7 +285,7 @@ paste "PASTE"
 [ test-cascade ] test-postgresql
 [ test-restrict ] test-postgresql
 
-: test-repeated-insert
+: test-repeated-insert ( -- )
     [ ] [ person ensure-table ] unit-test
     [ ] [ person1 get insert-tuple ] unit-test
     [ person1 get insert-tuple ] must-fail ;
@@ -458,7 +458,7 @@ TUPLE: bignum-test id m n o ;
         swap >>n
         swap >>m ;
 
-: test-bignum
+: test-bignum ( -- )
     bignum-test "BIGNUM_TEST"
     {
         { "id" "ID" +db-assigned-id+ }
@@ -478,7 +478,7 @@ TUPLE: bignum-test id m n o ;
 TUPLE: secret n message ;
 C: <secret> secret
 
-: test-random-id
+: test-random-id ( -- )
     secret "SECRET"
     {
         { "n" "ID" +random-id+ system-random-generator }
index 9bf07a5330a556dad88bbb3cb5ed8a65d333e187..cf822b40a351f25e2a92c7893b6342b3546369aa 100644 (file)
@@ -41,13 +41,13 @@ M: hello bing hello-test ;
 
 [ "USING: delegate ;\nIN: delegate.tests\nPROTOCOL: baz foo bar { whoa 1 } ; inline\n" ] [ [ baz see ] with-string-writer ] unit-test
 
-GENERIC: one
+GENERIC: one ( a -- b )
 M: integer one ;
-GENERIC: two
+GENERIC: two ( a -- b )
 M: integer two ;
-GENERIC: three
+GENERIC: three ( a -- b )
 M: integer three ;
-GENERIC: four
+GENERIC: four ( a -- b )
 M: integer four ;
 
 PROTOCOL: alpha one two ;
index 71894503945c43cd91b6944faef4b49f56543a00..d240e6f23374f769c15e3256843b24bc416d7420 100644 (file)
@@ -34,7 +34,7 @@ sequences eval accessors ;
     { "a" "b" "c" } swap map
 ] unit-test
 
-: funny-dip '[ [ @ ] dip ] call ; inline
+: funny-dip ( obj quot -- ) '[ [ @ ] dip ] call ; inline
 
 [ "hi" 3 ] [ "h" "i" 3 [ append ] funny-dip ] unit-test
 
index 60a526fb247996f05a7ca0b91001628c50d28dc1..cefeda04818c5084b8e678ac081b7985f89897b4 100644 (file)
@@ -7,7 +7,7 @@ IN: furnace.actions.tests
     [ "a" param "b" param [ string>number ] bi@ + ] >>display
 "action-1" set
 
-: lf>crlf "\n" split "\r\n" join ;
+: lf>crlf ( string -- string' ) "\n" split "\r\n" join ;
 
 STRING: action-request-test-1
 GET http://foo/bar?a=12&b=13 HTTP/1.1
index c591b848ec0f94eb0a29e7e8c4c035bd844dd96e..1d5aa43c7b18c99b3f1a0719d3da20c60a36becd 100644 (file)
@@ -4,7 +4,7 @@ http.server furnace furnace.utilities tools.test kernel
 namespaces accessors io.streams.string urls xml.writer ;
 TUPLE: funny-dispatcher < dispatcher ;
 
-: <funny-dispatcher> funny-dispatcher new-dispatcher ;
+: <funny-dispatcher> ( -- dispatcher ) funny-dispatcher new-dispatcher ;
 
 TUPLE: base-path-check-responder ;
 
index 14cdce3811b908e6ea111dbea459c053c74e3f70..b325c778cfa2ae8f8aac7d8adcde459e5fd2ec88 100644 (file)
@@ -6,7 +6,7 @@ io.streams.string io.files io.files.temp io.directories
 splitting destructors sequences db db.tuples db.sqlite\r
 continuations urls math.parser furnace furnace.utilities ;\r
 \r
-: with-session\r
+: with-session ( session quot -- )\r
     [\r
         [ [ save-session-after ] [ session set ] bi ] dip call\r
     ] with-destructors ; inline\r
@@ -22,7 +22,7 @@ M: foo call-responder*
     "x" [ 1+ ] schange\r
     "x" sget number>string "text/html" <content> ;\r
 \r
-: url-responder-mock-test\r
+: url-responder-mock-test ( -- )\r
     [\r
         <request>\r
             "GET" >>method\r
@@ -34,7 +34,7 @@ M: foo call-responder*
         [ write-response-body drop ] with-string-writer\r
     ] with-destructors ;\r
 \r
-: sessions-mock-test\r
+: sessions-mock-test ( -- )\r
     [\r
         <request>\r
             "GET" >>method\r
@@ -45,7 +45,7 @@ M: foo call-responder*
         [ write-response-body drop ] with-string-writer\r
     ] with-destructors ;\r
 \r
-: <exiting-action>\r
+: <exiting-action> ( -- action )\r
     <action>\r
         [ [ ] "text/plain" <content> exit-with ] >>display ;\r
 \r
index 5f1f07273615c311fb2f2100810148216e875681..6f97c7c3d5412fd65606f39540a6edef2d9b5253 100644 (file)
@@ -4,7 +4,7 @@ IN: hash2.tests
 [ t ] [ 1 2 { 1 2 } 2= ] unit-test
 [ f ] [ 1 3 { 1 2 } 2= ] unit-test
 
-: sample-hash
+: sample-hash ( -- )
     5 <hash2>
     dup 2 3 "foo" roll set-hash2
     dup 4 2 "bar" roll set-hash2
index 47c3105436c7a00e06e5a43c5267332f247077f8..2e01330d73ba9b723c62ae89085666822c19f552 100644 (file)
@@ -4,7 +4,7 @@ definitions assocs sequences kernel namespaces parser arrays
 io.streams.string continuations debugger compiler.units eval ;
 
 [ ] [
-    "IN: help.crossref.tests USING: help.syntax help.markup ; : foo ; HELP: foo \"foo is great\" ; ARTICLE: \"foo\" \"Foo\" { $subsection foo } ;" eval
+    "IN: help.crossref.tests USING: help.syntax help.markup ; : foo ( -- ) ; HELP: foo \"foo is great\" ; ARTICLE: \"foo\" \"Foo\" { $subsection foo } ;" eval
 ] unit-test
 
 [ $subsection ] [
@@ -23,7 +23,7 @@ io.streams.string continuations debugger compiler.units eval ;
 ] unit-test
 
 [ ] [
-    "IN: help.crossref.tests USING: help.syntax help.markup ; : bar ; HELP: bar \"bar is great\" ; ARTICLE: \"bar\" \"Bar\" { $subsection bar } ;" eval
+    "IN: help.crossref.tests USING: help.syntax help.markup ; : bar ( -- ) ; HELP: bar \"bar is great\" ; ARTICLE: \"bar\" \"Bar\" { $subsection bar } ;" eval
 ] unit-test
 
 [ ] [
index 5d83afae8886d91bd3e8a483bd9eb7a3b84d64f9..7bb66eca02fa2e019e72a300ba3889e5c2ae5e9a 100644 (file)
@@ -7,7 +7,7 @@ IN: help.definitions.tests
 
 [
     [ 4 ] [
-        "IN: help.definitions.tests USING: help.syntax ; : hello ; HELP: hello \"test\" ; ARTICLE: \"hello\" \"world\" ; ARTICLE: \"hello2\" \"world\" ;" <string-reader> "foo"
+        "IN: help.definitions.tests USING: help.syntax ; : hello ( -- ) ; HELP: hello \"test\" ; ARTICLE: \"hello\" \"world\" ; ARTICLE: \"hello2\" \"world\" ;" <string-reader> "foo"
         parse-stream drop
 
         "foo" source-file definitions>> first assoc-size
@@ -20,7 +20,7 @@ IN: help.definitions.tests
     ] unit-test
 
     [ 2 ] [
-        "IN: help.definitions.tests USING: help.syntax ; : hello ; ARTICLE: \"hello\" \"world\" ;" <string-reader> "foo"
+        "IN: help.definitions.tests USING: help.syntax ; : hello ( -- ) ; ARTICLE: \"hello\" \"world\" ;" <string-reader> "foo"
         parse-stream drop
 
         "foo" source-file definitions>> first assoc-size
@@ -32,7 +32,7 @@ IN: help.definitions.tests
         "hello" "help.definitions.tests" lookup "help" word-prop
     ] unit-test
 
-    [ ] [ "IN: help.definitions.tests USING: help.syntax ; : xxx ; HELP: xxx ;" eval ] unit-test
+    [ ] [ "IN: help.definitions.tests USING: help.syntax ; : xxx ( -- ) ; HELP: xxx ;" eval ] unit-test
 
     [ ] [ "xxx" "help.definitions.tests" lookup print-topic ] unit-test
 
index 74bc45d36c507799a046616119a721c9c7316d93..9b928f3691cb84d7e15bf71b773b04eeb4f2d046 100644 (file)
@@ -11,7 +11,7 @@ TUPLE: blahblah quux ;
 [ ] [ \ >>quux print-topic ] unit-test
 [ ] [ \ blahblah? print-topic ] unit-test
 
-: fooey "fooey" throw ;
+: fooey ( -- * ) "fooey" throw ;
 
 [ ] [ \ fooey print-topic ] unit-test
 
index 86f86a8468e8b62bd4c88b312de78b842497a8c9..fd786d355dba983bd4a6a8b0bc1388849b4e9535 100644 (file)
@@ -5,7 +5,7 @@ splitting unicode.categories furnace accessors
 html.templates.chloe.compiler ;
 IN: html.templates.chloe.tests
 
-: run-template
+: run-template ( quot -- string )
     with-string-writer [ "\r\n\t" member? not ] filter
     "?>" split1 nip ; inline
 
@@ -37,7 +37,7 @@ IN: html.templates.chloe.tests
     ] run-template
 ] unit-test
 
-: test4-aux? t ;
+: test4-aux? ( -- ? ) t ;
 
 [ "True" ] [
     [
@@ -45,7 +45,7 @@ IN: html.templates.chloe.tests
     ] run-template
 ] unit-test
 
-: test5-aux? f ;
+: test5-aux? ( -- ? ) f ;
 
 [ "" ] [
     [
index 0d4282b1d7b8efd656e4a0c0fbedccf60121140f..bc906fad44b3e4862e84d8ca15b33c0ea1f5eb97 100644 (file)
@@ -13,7 +13,7 @@ IN: http.tests
 
 [ "application/octet-stream" binary ] [ "application/octet-stream" parse-content-type ] unit-test
 
-: lf>crlf "\n" split "\r\n" join ;
+: lf>crlf ( string -- string' ) "\n" split "\r\n" join ;
 
 STRING: read-request-test-1
 POST /bar HTTP/1.1
@@ -180,14 +180,14 @@ accessors namespaces threads
 http.server.responses http.server.redirection furnace.redirection
 http.server.dispatchers db.tuples ;
 
-: add-quit-action
+: add-quit-action ( responder -- responder )
     <action>
         [ stop-this-server "Goodbye" "text/html" <content> ] >>display
     "quit" add-responder ;
 
-: test-db-file "test.db" temp-file ;
+: test-db-file ( -- path ) "test.db" temp-file ;
 
-: test-db test-db-file <sqlite-db> ;
+: test-db ( -- db ) test-db-file <sqlite-db> ;
 
 [ test-db-file delete-file ] ignore-errors
 
@@ -268,7 +268,7 @@ test-db [
     test-httpd
 ] unit-test
 
-: 404? [ download-failed? ] [ response>> code>> 404 = ] bi and ;
+: 404? ( response -- ? ) [ download-failed? ] [ response>> code>> 404 = ] bi and ;
 
 ! This should give a 404 not an infinite redirect loop
 [ "http://localhost/d/blah" add-port http-get nip ] [ 404? ] must-fail-with
index 2e94d7a2df0fea1e76333bde26c29273f132f58e..ed054d79582010892db2e842375bd57a01cb4f95 100644 (file)
@@ -5,7 +5,7 @@ io.streams.duplex destructors make io.launcher ;
 IN: io.backend.unix.tests
 
 ! Unix domain stream sockets
-: socket-server "unix-domain-socket-test" temp-file ;
+: socket-server ( -- path ) "unix-domain-socket-test" temp-file ;
 
 [
     [ socket-server delete-file ] ignore-errors
@@ -33,8 +33,8 @@ yield
     ] { } make
 ] unit-test
 
-: datagram-server "unix-domain-datagram-test" temp-file ;
-: datagram-client "unix-domain-datagram-test-2" temp-file ;
+: datagram-server ( -- path ) "unix-domain-datagram-test" temp-file ;
+: datagram-client ( -- path ) "unix-domain-datagram-test-2" temp-file ;
 
 ! Unix domain datagram sockets
 [ datagram-server delete-file ] ignore-errors
@@ -104,7 +104,7 @@ datagram-client <local> <datagram>
 [ ] [ "d" get dispose ] unit-test
 
 ! Test error behavior
-: another-datagram "unix-domain-datagram-test-3" temp-file ;
+: another-datagram ( -- path ) "unix-domain-datagram-test-3" temp-file ;
 
 [ another-datagram delete-file ] ignore-errors
 
index 5e7d1af8f57622a5c35538a43c059f9978c535b4..9f3f35ff2a7136f01ab3256eee86f100e025d970 100644 (file)
@@ -2,7 +2,7 @@ USING: accessors alien.c-types kernel
 io.encodings.utf16 io.streams.byte-array tools.test ;
 IN: io.encodings.utf16n
 
-: correct-endian
+: correct-endian ( obj -- ? )
     code>> little-endian? [ utf16le = ] [ utf16be = ] if ;
 
 [ t ] [ B{ } utf16n <byte-reader> correct-endian ] unit-test
index 860702c5635b50853db0b34f7d30a7f40a4aef8a..4903db2b1b79615c695cab06035ea0ef70250f13 100644 (file)
@@ -5,13 +5,13 @@ IN: io.streams.duplex.tests
 ! Test duplex stream close behavior
 TUPLE: closing-stream < disposable ;
 
-: <closing-stream> closing-stream new ;
+: <closing-stream> ( -- stream ) closing-stream new ;
 
 M: closing-stream dispose* drop ;
 
 TUPLE: unclosable-stream ;
 
-: <unclosable-stream> unclosable-stream new ;
+: <unclosable-stream> ( -- stream ) unclosable-stream new ;
 
 M: unclosable-stream dispose
     "Can't close me!" throw ;
index 00f1cca678298dd2687bd0826d6b5938296fb682..0616794939ee6a405eaa3fd1c5db3638dff6dbc8 100644 (file)
@@ -50,7 +50,7 @@ SYNTAX: hello "Hi" print ;
 
 [
     [ ] [
-        "IN: listener.tests : hello\n\"world\" ;" parse-interactive
+        "IN: listener.tests : hello ( -- )\n\"world\" ;" parse-interactive
         drop
     ] unit-test
 ] with-file-vocabs
index 558fa78494bd1eb34143bc614092d78b54792955..8e3b59fe69743d7a5d540fa1fff410f6d49ead3c 100644 (file)
@@ -192,14 +192,14 @@ M:: string lambda-generic ( a b -- c ) a b lambda-generic-2 ;
 DEFER: xyzzy
 
 [ ] [
-    "IN: locals.tests USE: math GENERIC: xyzzy M: integer xyzzy ;"
+    "IN: locals.tests USE: math GENERIC: xyzzy ( a -- b ) M: integer xyzzy ;"
     <string-reader> "lambda-generic-test" parse-stream drop
 ] unit-test
 
 [ 10 ] [ 10 xyzzy ] unit-test
 
 [ ] [
-    "IN: locals.tests USE: math USE: locals GENERIC: xyzzy M:: integer xyzzy ( n -- ) 5 ;"
+    "IN: locals.tests USE: math USE: locals GENERIC: xyzzy ( a -- b ) M:: integer xyzzy ( n -- x ) 5 ;"
     <string-reader> "lambda-generic-test" parse-stream drop
 ] unit-test
 
@@ -245,7 +245,7 @@ M:: fixnum next-method-test ( a -- b ) a call-next-method 1 + ;
 
 [ 5 ] [ 1 next-method-test ] unit-test
 
-: no-with-locals-test { 1 2 3 } [| x | x 3 + ] map ;
+: no-with-locals-test ( -- seq ) { 1 2 3 } [| x | x 3 + ] map ;
 
 [ { 4 5 6 } ] [ no-with-locals-test ] unit-test
 
@@ -259,7 +259,7 @@ M:: fixnum next-method-test ( a -- b ) a call-next-method 1 + ;
 
 :: a-word-with-locals ( a b -- ) ;
 
-: new-definition "USING: math ;\nIN: locals.tests\n: a-word-with-locals ( -- x ) 2 3 + ;\n" ;
+CONSTANT: new-definition "USING: math ;\nIN: locals.tests\n: a-word-with-locals ( -- x ) 2 3 + ;\n"
 
 [ ] [ new-definition eval ] unit-test
 
@@ -268,7 +268,7 @@ M:: fixnum next-method-test ( a -- b ) a call-next-method 1 + ;
     new-definition =
 ] unit-test
 
-: method-definition "USING: locals locals.tests sequences ;\nM:: sequence method-with-locals ( a -- y ) a reverse ;\n" ;
+CONSTANT: method-definition "USING: locals locals.tests sequences ;\nM:: sequence method-with-locals ( a -- y ) a reverse ;\n"
 
 GENERIC: method-with-locals ( x -- y )
 
index 7d93ce8a9ea4b83eb98ca66d1ca43819f77bc64d..91aa6880e6b6cfa845a81021906cb0808d84a1cd 100644 (file)
@@ -2,16 +2,22 @@ IN: macros.tests
 USING: tools.test macros math kernel arrays
 vectors io.streams.string prettyprint parser eval see ;
 
-MACRO: see-test ( a b -- c ) + ;
+MACRO: see-test ( a b -- quot ) + ;
 
-[ "USING: macros math ;\nIN: macros.tests\nMACRO: see-test ( a b -- c ) + ;\n" ]
+[ t ] [ \ see-test macro? ] unit-test
+
+[ "USING: macros math ;\nIN: macros.tests\nMACRO: see-test ( a b -- quot ) + ;\n" ]
 [ [ \ see-test see ] with-string-writer ]
 unit-test
 
+[ t ] [ \ see-test macro? ] unit-test
+
 [ t ] [
     "USING: math ;\nIN: macros.tests\n: see-test ( a b -- c ) - ;\n" dup eval
     [ \ see-test see ] with-string-writer =
 ] unit-test
 
+[ f ] [ \ see-test macro? ] unit-test
+
 [ ] [ "USING: macros stack-checker kernel ; IN: hanging-macro MACRO: c ( quot -- ) infer drop [ ] ; : a ( -- ) [ a ] c ;" eval ] unit-test
 
index f64c88388aa5fb84e0415d4f37170fa7a38c85ac..a86b711340526c4b19b12d68005abd66d19c0d36 100644 (file)
@@ -7,14 +7,14 @@ IN: macros
 <PRIVATE
 
 : real-macro-effect ( effect -- effect' )
-    in>> 1 <effect> ;
+    in>> { "quot" } <effect> ;
 
 PRIVATE>
 
 : define-macro ( word definition effect -- )
     real-macro-effect
-    [ drop "macro" set-word-prop ]
     [ [ memoize-quot [ call ] append ] keep define-declared ]
+    [ drop "macro" set-word-prop ]
     3bi ;
 
 SYNTAX: MACRO: (:) define-macro ;
index 67155b83032f2ae6d877a63a45ab756bdfd99d81..f875fa31400d069b132c581388bb2796fcff6b69 100644 (file)
@@ -4,7 +4,7 @@ IN: models.tests
 
 TUPLE: model-tester hit? ;
 
-: <model-tester> model-tester new ;
+: <model-tester> ( -- model-tester ) model-tester new ;
 
 M: model-tester model-changed nip t >>hit? drop ;
 
index 50c0365728246e1ebc2fc0554de74d0045569197..e9119e8452e5e8896fbd98365c4e6192b3d06aea 100644 (file)
@@ -3,7 +3,7 @@ USING: arrays generic kernel math models namespaces sequences assocs
 tools.test models.range ;\r
 \r
 ! Test <range> \r
-: setup-range 0 0 0 255 <range> ;\r
+: setup-range ( -- range ) 0 0 0 255 <range> ;\r
 \r
 ! clamp-value should not go past range ends\r
 [ 0   ] [ -10 setup-range clamp-value ] unit-test\r
index cecd6dab539bb57b72f4722c0b114d691e7415d9..3a1f910532cfcf07e83806fa219899818ea1d4dc 100644 (file)
@@ -1,9 +1,9 @@
 USING: persistent.heaps tools.test ;
 IN: persistent.heaps.tests
 
-: test-input
+CONSTANT: test-input
     { { "hello" 3 } { "goodbye" 2 } { "whatever" 5 }
-      { "foo" 1 } { "bar" -1 } { "baz" -7 } { "bing" 0 } } ;
+      { "foo" 1 } { "bar" -1 } { "baz" -7 } { "bing" 0 } }
 
 [
     { { "baz" -7 } { "bar" -1 } { "bing" 0 } { "foo" 1 }
index aaaf6b80d1040df7e062c0d26890568afa8e43f4..7e37aa0da57fe910de07c6c7c6a73543191a731f 100644 (file)
@@ -63,7 +63,7 @@ unit-test
 [ "USING: math ;\nIN: prettyprint.tests\n: bar ( x -- y ) 2 + ;\n" ]
 [ [ \ bar see ] with-string-writer ] unit-test
 
-: blah 
+: blah ( a a a a a a a a a a a a a a a a a a a a -- )
     drop
     drop
     drop
@@ -102,7 +102,7 @@ unit-test
         ] keep =
     ] with-scope ;
 
-GENERIC: method-layout
+GENERIC: method-layout ( a -- b )
 
 M: complex method-layout
     "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
@@ -135,7 +135,7 @@ M: object method-layout ;
     [ \ method-layout see-methods ] with-string-writer "\n" split
 ] unit-test
 
-: soft-break-test
+: soft-break-test ( -- str )
     {
         "USING: kernel math sequences strings ;"
         "IN: prettyprint.tests"
@@ -152,7 +152,7 @@ M: object method-layout ;
 
 DEFER: parse-error-file
 
-: another-soft-break-test
+: another-soft-break-test ( -- str )
     {
         "USING: make sequences ;"
         "IN: prettyprint.tests"
@@ -166,7 +166,7 @@ DEFER: parse-error-file
     check-see
 ] unit-test
 
-: string-layout
+: string-layout ( -- str )
     {
         "USING: accessors debugger io kernel ;"
         "IN: prettyprint.tests"
@@ -187,7 +187,7 @@ DEFER: parse-error-file
 
 \ send soft "break-after" set-word-prop
 
-: final-soft-break-test
+: final-soft-break-test ( -- str )
     {
         "USING: kernel sequences ;"
         "IN: prettyprint.tests"
@@ -202,7 +202,7 @@ DEFER: parse-error-file
     "final-soft-break-layout" final-soft-break-test check-see
 ] unit-test
 
-: narrow-test
+: narrow-test ( -- str )
     {
         "USING: arrays combinators continuations kernel sequences ;"
         "IN: prettyprint.tests"
@@ -218,7 +218,7 @@ DEFER: parse-error-file
     "narrow-layout" narrow-test check-see
 ] unit-test
 
-: another-narrow-test
+: another-narrow-test ( -- str )
     {
         "IN: prettyprint.tests"
         ": another-narrow-layout ( -- obj )"
@@ -326,7 +326,7 @@ INTERSECTION: intersection-see-test sequence number ;
     
 TUPLE: started-out-hustlin' ;
 
-GENERIC: ended-up-ballin'
+GENERIC: ended-up-ballin' ( a -- b )
 
 M: started-out-hustlin' ended-up-ballin' ; inline
 
index 99c6d0e255f7afa586f2cae27d67d0d8853ec7b0..d23c8be84b928aef2aa3ed69c719918dd0e98711 100644 (file)
@@ -7,7 +7,7 @@ sequences math prettyprint parser classes math.constants
 io.encodings.binary random assocs serialize.private ;
 IN: serialize.tests
 
-: test-serialize-cell
+: test-serialize-cell ( a -- ? )
     2^ random dup
     binary [ serialize-cell ] with-byte-writer
     binary [ deserialize-cell ] with-byte-reader = ;
@@ -27,7 +27,7 @@ TUPLE: serialize-test a b ;
 
 C: <serialize-test> serialize-test
 
-: objects
+CONSTANT: objects
     {
         f
         t
@@ -52,7 +52,7 @@ C: <serialize-test> serialize-test
         << 1 [ 2 ] curry parsed >>
         { { "a" "bc" } { "de" "fg" } }
         H{ { "a" "bc" } { "de" "fg" } }
-    } ;
+    }
 
 : check-serialize-1 ( obj -- ? )
     "=====" print
index 7e377aedd90abe4390ddebc3b9ddfa8d64a52337..f47852aca754115dcb54d1f9ec944c27f748b8e4 100644 (file)
@@ -2,7 +2,7 @@ USING: tools.test tools.annotations tools.time math parser eval
 io.streams.string kernel strings ;
 IN: tools.annotations.tests
 
-: foo ;
+: foo ( -- ) ;
 \ foo watch
 
 [ ] [ foo ] unit-test
index d4f2fea2e5c97229f1cf1198ab71c55e46243f90..d08a17fd020eb1157e7980770347ae6e0a751902 100755 (executable)
@@ -3,7 +3,7 @@ tools.crossref tools.test parser namespaces source-files generic
 definitions ;
 IN: tools.crossref.tests
 
-GENERIC: foo
+GENERIC: foo ( a b -- c )
 
 M: integer foo + ;
 
index f8026765830160e95a7d10b151bac86c2d4e6da2..3a5877c2861c5095f91cec26ff457612a4e2afef 100644 (file)
@@ -36,7 +36,7 @@ IN: tools.walker.tests
     [ 2 2 fixnum+ ] test-walker
 ] unit-test
 
-: foo 2 2 fixnum+ ;
+: foo ( -- x ) 2 2 fixnum+ ;
 
 [ { 8 } ] [
     [ foo 4 fixnum+ ] test-walker
index 6d1706ee748fdc4552bf4455ba5f15a182ef1404..0aa12f72793dff3816c27ba9d54792144f3ae0c3 100644 (file)
@@ -5,9 +5,9 @@ IN: ui.gadgets.buttons.tests
 
 TUPLE: foo-gadget ;
 
-: com-foo-a ;
+: com-foo-a ( -- ) ;
 
-: com-foo-b ;
+: com-foo-b ( -- ) ;
 
 \ foo-gadget "toolbar" f {
     { f com-foo-a }
index baeb320447ec129ddbca4986f26b4a685ca571ea..03219c66fdf5ecc11e53b187e5eeafe049f5c283 100644 (file)
@@ -119,14 +119,14 @@ M: mock-gadget ungraft*
         [ { f f } ] [ "g" get graft-state>> ] unit-test
     ] with-variable
 
-    : add-some-children
+    : add-some-children ( gadget -- gadget )
         3 [
             <mock-gadget> over <model> >>model
             "g" get over add-gadget drop
             swap 1+ number>string set
         ] each ;
 
-    : status-flags
+    : status-flags ( -- seq )
         { "g" "1" "2" "3" } [ get graft-state>> ] map prune ;
 
     : notify-combo ( ? ? -- )
index 2947ce242d14f451cc9517052482319762ca80e3..0c47af0214f8b498acc7ffa984f261c12ee19158 100644 (file)
@@ -5,7 +5,7 @@ help.stylesheet splitting tools.test.ui models math summary
 inspector accessors help.topics see ;
 IN: ui.gadgets.panes.tests
 
-: #children "pane" get children>> length ;
+: #children ( -- n ) "pane" get children>> length ;
 
 [ ] [ <pane> "pane" set ] unit-test
 
index fe7a8b52c5b31674c3c84ae75b25d0220d00bf83..4612ea79b0a1cfe13b783ce9ed2dd5885fb440fa 100644 (file)
@@ -3,7 +3,7 @@ USING: ui.operations ui.commands prettyprint kernel namespaces
 tools.test ui.gadgets ui.gadgets.editors parser io
 io.streams.string math help help.markup accessors ;
 
-: my-pprint pprint ;
+: my-pprint ( obj -- ) pprint ;
 
 [ drop t ] \ my-pprint [ ] f operation boa "op" set
 
index cd56dd876e6812f8c06a3d84a696980864a4bb88..63df55b71a488edb9470132d83374dd5ce759be5 100644 (file)
@@ -68,7 +68,7 @@ IN: ui.tools.listener.tests
 
 [ ] [ <interactor> <pane> <pane-stream> >>output "interactor" set ] unit-test
 
-: text "Hello world.\nThis is a test." ;
+CONSTANT: text "Hello world.\nThis is a test."
 
 [ ] [ text "interactor" get set-editor-string ] unit-test
 
index cac206bf3cc8cfe44e39c2c84a5e5c232411127e..74eea9506c2bc428016eb0fcb91414a8e7b97667 100644 (file)
@@ -2,7 +2,7 @@ IN: urls.tests
 USING: urls urls.private tools.test
 arrays kernel assocs present accessors ;
 
-: urls
+CONSTANT: urls
     {
         {
             T{ url
@@ -80,7 +80,7 @@ arrays kernel assocs present accessors ;
             }
             "ftp://slava:secret@ftp.kernel.org/"
         }
-    } ;
+    }
 
 urls [
     [ 1array ] [ [ >url ] curry ] bi* unit-test
index d9011ad776b61710d371b83f9bc338df00fbbc57..9d0bb7d16f35ea87e82e4fdf68c143d10699fe5b 100644 (file)
@@ -13,7 +13,7 @@ GENERIC: zammo ( obj -- str )
 
 SINGLETON: word-and-singleton
 
-: word-and-singleton 3 ;
+: word-and-singleton ( -- x ) 3 ;
 
 [ t ] [ \ word-and-singleton word-and-singleton? ] unit-test
 [ 3 ] [ word-and-singleton ] unit-test
index be7d93873e40328595f1fefac15c919e53c379a1..76f9f63c49be13be25f66bd60a7e08af227d05c4 100644 (file)
@@ -288,7 +288,7 @@ CONSTANT: case-const-2 2
     } case
 ] unit-test
 
-: do-not-call "do not call" throw ;
+: do-not-call ( -- * ) "do not call" throw ;
 
 : test-case-6 ( obj -- value )
     {
index d5bd0da663b5b2e581657f0e632c914f5413583b..34a4ed28794c7b5d32f41902a0c0b74955c43cc9 100644 (file)
@@ -3,7 +3,7 @@ continuations debugger parser memory arrays words
 kernel.private accessors eval ;
 IN: continuations.tests
 
-: (callcc1-test)
+: (callcc1-test) ( -- )
     [ 1- dup ] dip ?push
     over 0 = [ "test-cc" get continue-with ] when
     (callcc1-test) ;
@@ -59,10 +59,10 @@ IN: continuations.tests
 ! : callstack-overflow callstack-overflow f ;
 ! [ callstack-overflow ] must-fail
 
-: don't-compile-me { } [ ] each ;
+: don't-compile-me ( -- ) { } [ ] each ;
 
-: foo callstack "c" set 3 don't-compile-me ;
-: bar 1 foo 2 ;
+: foo ( -- ) callstack "c" set 3 don't-compile-me ;
+: bar ( -- a b ) 1 foo 2 ;
 
 [ 1 3 2 ] [ bar ] unit-test
 
index e09a88aee4ba7acef0643b612f5fd1b45158597e..f9d0770d0238f4605b0b93786e8260add302db95 100644 (file)
@@ -21,7 +21,7 @@ T{ dispose-dummy } "b" set
 
 TUPLE: dummy-obj destroyed? ;
 
-: <dummy-obj> dummy-obj new ;
+: <dummy-obj> ( -- obj ) dummy-obj new ;
 
 TUPLE: dummy-destructor obj ;
 
@@ -30,10 +30,10 @@ C: <dummy-destructor> dummy-destructor
 M: dummy-destructor dispose ( obj -- )
     obj>> t >>destroyed? drop ;
 
-: destroy-always
+: destroy-always ( obj -- )
     <dummy-destructor> &dispose drop ;
 
-: destroy-later
+: destroy-later ( obj -- )
     <dummy-destructor> |dispose drop ;
 
 [ t ] [
index 959f145bf53f75f63191a3b0d1cb814f16af3667..e6ac5760aaa2a4dcfdb58c2b768cd24113e33e2f 100644 (file)
@@ -1,4 +1,4 @@
 IN: io.tests
 USE: math
-: foo 2 2 + ;
+: foo ( -- x ) 2 2 + ;
 FORGET: foo
\ No newline at end of file
index 4d725e57f892c3b150a992c63b838d5573d2545b..63346f4701fecfea0a490c394377aa83be4408c3 100644 (file)
@@ -21,21 +21,21 @@ IN: kernel.tests
 
 [ ] [ :c ] unit-test
 
-: overflow-d 3 overflow-d ;
+: overflow-d ( -- ) 3 overflow-d ;
 
 [ overflow-d ] [ { "kernel-error" 12 f f } = ] must-fail-with
 
 [ ] [ :c ] unit-test
 
-: (overflow-d-alt) 3 ;
+: (overflow-d-alt) ( -- ) 3 ;
 
-: overflow-d-alt (overflow-d-alt) overflow-d-alt ;
+: overflow-d-alt ( -- ) (overflow-d-alt) overflow-d-alt ;
 
 [ overflow-d-alt ] [ { "kernel-error" 12 f f } = ] must-fail-with
 
 [ ] [ [ :c ] with-string-writer drop ] unit-test
 
-: overflow-r 3 load-local overflow-r ;
+: overflow-r ( -- ) 3 load-local overflow-r ;
 
 [ overflow-r ] [ { "kernel-error" 14 f f } = ] must-fail-with
 
@@ -99,7 +99,7 @@ IN: kernel.tests
 [ ] [ :c ] unit-test
 
 ! Doesn't compile; important
-: foo 5 + 0 [ ] each ;
+: foo ( a -- b ) 5 + 0 [ ] each ;
 
 [ drop foo ] must-fail
 [ ] [ :c ] unit-test
@@ -115,7 +115,7 @@ IN: kernel.tests
 [ loop ] must-fail
 
 ! Discovered on Windows
-: total-failure-1 "" [ ] map unimplemented ;
+: total-failure-1 ( -- ) "" [ ] map unimplemented ;
 
 [ total-failure-1 ] must-fail
 
index 2616e5fadb0132c1b6d3e7cfb3c22cb577c90e68..3ba414fe6beb9304cbd6ff56def0e823ddd92697 100644 (file)
@@ -27,7 +27,7 @@ IN: parser.tests
 
     [ "hello world" ]
     [
-        "IN: parser.tests : hello \"hello world\" ;"
+        "IN: parser.tests : hello ( -- str ) \"hello world\" ;"
         eval "USE: parser.tests hello" eval
     ] unit-test
 
@@ -78,12 +78,8 @@ IN: parser.tests
     [ T{ effect f { "a" "b" } { "d" } f } ]
     [ \ effect-parsing-test "declared-effect" word-prop ] unit-test
 
-    [ ] [ "IN: parser.tests : effect-parsing-test ;" eval ] unit-test
-
-    [ f ] [ \ effect-parsing-test "declared-effect" word-prop ] unit-test
-
     ! Funny bug
-    [ 2 ] [ "IN: parser.tests : \0. 2 ; \0." eval ] unit-test
+    [ 2 ] [ "IN: parser.tests : \0. ( -- x ) 2 ; \0." eval ] unit-test
 
     [ "IN: parser.tests : missing-- ( a b ) ;" eval ] must-fail
 
@@ -110,7 +106,7 @@ IN: parser.tests
 
     [ ] [ "USE: parser.tests foo" eval ] unit-test
 
-    "IN: parser.tests USING: math prettyprint ; : foo 2 2 + . ;" eval
+    "IN: parser.tests USING: math prettyprint ; : foo ( -- ) 2 2 + . ;" eval
 
     [ t ] [
         "USE: parser.tests \\ foo" eval
@@ -120,7 +116,7 @@ IN: parser.tests
     ! Test smudging
 
     [ 1 ] [
-        "IN: parser.tests : smudge-me ;" <string-reader> "foo"
+        "IN: parser.tests : smudge-me ( -- ) ;" <string-reader> "foo"
         parse-stream drop
 
         "foo" source-file definitions>> first assoc-size
@@ -129,7 +125,7 @@ IN: parser.tests
     [ t ] [ "smudge-me" "parser.tests" lookup >boolean ] unit-test
 
     [ ] [
-        "IN: parser.tests : smudge-me-more ;" <string-reader> "foo"
+        "IN: parser.tests : smudge-me-more ( -- ) ;" <string-reader> "foo"
         parse-stream drop
     ] unit-test
 
@@ -137,7 +133,7 @@ IN: parser.tests
     [ f ] [ "smudge-me" "parser.tests" lookup >boolean ] unit-test
 
     [ 3 ] [
-        "IN: parser.tests USING: math strings ; GENERIC: smudge-me M: integer smudge-me ; M: string smudge-me ;" <string-reader> "foo"
+        "IN: parser.tests USING: math strings ; GENERIC: smudge-me ( a -- b ) M: integer smudge-me ; M: string smudge-me ;" <string-reader> "foo"
         parse-stream drop
 
         "foo" source-file definitions>> first assoc-size
@@ -151,7 +147,7 @@ IN: parser.tests
     ] unit-test
 
     [ 2 ] [
-        "IN: parser.tests USING: math strings ; GENERIC: smudge-me M: integer smudge-me ;" <string-reader> "foo"
+        "IN: parser.tests USING: math strings ; GENERIC: smudge-me ( a -- b ) M: integer smudge-me ;" <string-reader> "foo"
         parse-stream drop
 
         "foo" source-file definitions>> first assoc-size
@@ -190,7 +186,7 @@ IN: parser.tests
     [ ] [
         "a" source-files get delete-at
         2 [
-            "IN: parser.tests DEFER: x : y x ; : x y ;"
+            "IN: parser.tests DEFER: x : y ( -- ) x ; : x ( -- ) y ;"
             <string-reader> "a" parse-stream drop
         ] times
     ] unit-test
@@ -198,7 +194,7 @@ IN: parser.tests
     "a" source-files get delete-at
 
     [
-        "IN: parser.tests : x ; : y 3 throw ; this is an error"
+        "IN: parser.tests : x ( -- ) ; : y ( -- * ) 3 throw ; this is an error"
         <string-reader> "a" parse-stream
     ] [ source-file-error? ] must-fail-with
 
@@ -207,7 +203,7 @@ IN: parser.tests
     ] unit-test
 
     [ f ] [
-        "IN: parser.tests : x ;"
+        "IN: parser.tests : x ( -- ) ;"
         <string-reader> "a" parse-stream drop
         
         "y" "parser.tests" lookup
@@ -215,18 +211,18 @@ IN: parser.tests
 
     ! Test new forward definition logic
     [ ] [
-        "IN: axx : axx ;"
+        "IN: axx : axx ( -- ) ;"
         <string-reader> "axx" parse-stream drop
     ] unit-test
 
     [ ] [
-        "USE: axx IN: bxx : bxx ; : cxx axx bxx ;"
+        "USE: axx IN: bxx : bxx ( -- ) ; : cxx ( -- ) axx bxx ;"
         <string-reader> "bxx" parse-stream drop
     ] unit-test
 
     ! So we move the bxx word to axx...
     [ ] [
-        "IN: axx : axx ; : bxx ;"
+        "IN: axx : axx ( -- ) ; : bxx ( -- ) ;"
         <string-reader> "axx" parse-stream drop
     ] unit-test
 
@@ -234,7 +230,7 @@ IN: parser.tests
 
     ! And reload the file that uses it...
     [ ] [
-        "USE: axx IN: bxx : cxx axx bxx ;"
+        "USE: axx IN: bxx ( -- ) : cxx ( -- ) axx bxx ;"
         <string-reader> "bxx" parse-stream drop
     ] unit-test
     
@@ -243,17 +239,17 @@ IN: parser.tests
     ! Turning a generic into a non-generic could cause all
     ! kinds of funnyness
     [ ] [
-        "IN: ayy USE: kernel GENERIC: ayy M: object ayy ;"
+        "IN: ayy USE: kernel GENERIC: ayy ( a -- b ) M: object ayy ;"
         <string-reader> "ayy" parse-stream drop
     ] unit-test
 
     [ ] [
-        "IN: ayy USE: kernel : ayy ;"
+        "IN: ayy USE: kernel : ayy ( -- ) ;"
         <string-reader> "ayy" parse-stream drop
     ] unit-test
 
     [ ] [
-        "IN: azz TUPLE: my-class ; GENERIC: a-generic"
+        "IN: azz TUPLE: my-class ; GENERIC: a-generic ( a -- b )"
         <string-reader> "azz" parse-stream drop
     ] unit-test
 
@@ -263,7 +259,7 @@ IN: parser.tests
     ] unit-test
 
     [ ] [
-        "IN: azz GENERIC: a-generic"
+        "IN: azz GENERIC: a-generic ( a -- b )"
         <string-reader> "azz" parse-stream drop
     ] unit-test
 
@@ -273,12 +269,12 @@ IN: parser.tests
     ] unit-test
 
     [ ] [
-        "IN: parser.tests : <bogus-error> ; : bogus <bogus-error> ;"
+        "IN: parser.tests : <bogus-error> ( -- ) ; : bogus ( -- ) <bogus-error> ;"
         <string-reader> "bogus-error" parse-stream drop
     ] unit-test
 
     [ ] [
-        "IN: parser.tests TUPLE: bogus-error ; C: <bogus-error> bogus-error : bogus <bogus-error> ;"
+        "IN: parser.tests TUPLE: bogus-error ; C: <bogus-error> bogus-error : bogus ( -- ) <bogus-error> ;"
         <string-reader> "bogus-error" parse-stream drop
     ] unit-test
 
@@ -298,7 +294,7 @@ IN: parser.tests
     ] unit-test
 
     [
-        "IN: parser.tests TUPLE: another-pred-test ; GENERIC: another-pred-test?"
+        "IN: parser.tests TUPLE: another-pred-test ; GENERIC: another-pred-test? ( a -- b )"
         <string-reader> "removing-the-predicate" parse-stream
     ] [ error>> error>> error>> redefine-error? ] must-fail-with
 
@@ -313,7 +309,7 @@ IN: parser.tests
     ] unit-test
 
     [
-        "IN: parser.tests TUPLE: class-redef-test ; SYMBOL: class-redef-test : class-redef-test ;"
+        "IN: parser.tests TUPLE: class-redef-test ; SYMBOL: class-redef-test : class-redef-test ( -- ) ;"
         <string-reader> "redefining-a-class-3" parse-stream drop
     ] [ error>> error>> error>> redefine-error? ] must-fail-with
 
@@ -338,7 +334,7 @@ IN: parser.tests
     ] [ error>> error>> error>> no-word-error? ] must-fail-with
 
     [
-        "IN: parser.tests : foo ; TUPLE: foo ;"
+        "IN: parser.tests : foo ( -- ) ; TUPLE: foo ;"
         <string-reader> "redefining-a-class-4" parse-stream drop
     ] [ error>> error>> error>> redefine-error? ] must-fail-with
 
@@ -369,7 +365,7 @@ IN: parser.tests
 
 2 [
     [ ] [
-        "IN: parser.tests TUPLE: foo ; GENERIC: foo"
+        "IN: parser.tests TUPLE: foo ; GENERIC: foo ( a -- b )"
         <string-reader> "redefining-a-class-5" parse-stream drop
     ] unit-test
 
@@ -381,14 +377,14 @@ IN: parser.tests
     [ f ] [ f "foo" "parser.tests" lookup execute ] unit-test
 
     [ ] [
-        "IN: parser.tests TUPLE: foo ; GENERIC: foo"
+        "IN: parser.tests TUPLE: foo ; GENERIC: foo ( a -- b )"
         <string-reader> "redefining-a-class-5" parse-stream drop
     ] unit-test
 
     [ f ] [ f "foo" "parser.tests" lookup execute ] unit-test
 
     [ ] [
-        "IN: parser.tests TUPLE: foo ; GENERIC: foo"
+        "IN: parser.tests TUPLE: foo ; GENERIC: foo ( a -- b )"
     <string-reader> "redefining-a-class-7" parse-stream drop
     ] unit-test
 
@@ -438,7 +434,7 @@ IN: parser.tests
     {
         "IN: parser.tests"
         "USING: math arrays ;"
-        "GENERIC: change-combination"
+        "GENERIC: change-combination ( a -- b )"
         "M: integer change-combination 1 ;"
         "M: array change-combination 2 ;"
     } "\n" join <string-reader> "change-combination-test" parse-stream drop
@@ -448,7 +444,7 @@ IN: parser.tests
     {
         "IN: parser.tests"
         "USING: math arrays ;"
-        "GENERIC# change-combination 1"
+        "GENERIC# change-combination 1 ( a -- b )"
         "M: integer change-combination 1 ;"
         "M: array change-combination 2 ;"
     } "\n" join <string-reader> "change-combination-test" parse-stream drop
@@ -467,7 +463,7 @@ IN: parser.tests
 ] unit-test
 
 [ [ ] ] [
-    "IN: parser.tests : staging-problem-test-1 1 ; : staging-problem-test-2 staging-problem-test-1 ;"
+    "IN: parser.tests : staging-problem-test-1 ( -- ) 1 ; : staging-problem-test-2 ( -- ) staging-problem-test-1 ;"
     <string-reader> "staging-problem-test" parse-stream
 ] unit-test
 
@@ -476,7 +472,7 @@ IN: parser.tests
 [ t ] [ "staging-problem-test-2" "parser.tests" lookup >boolean ] unit-test
 
 [ [ ] ] [
-    "IN: parser.tests << : staging-problem-test-1 1 ; >> : staging-problem-test-2 staging-problem-test-1 ;"
+    "IN: parser.tests << : staging-problem-test-1 ( -- ) 1 ; >> : staging-problem-test-2 ( -- ) staging-problem-test-1 ;"
     <string-reader> "staging-problem-test" parse-stream
 ] unit-test
 
@@ -495,7 +491,7 @@ IN: parser.tests
 ! Bogus error message
 DEFER: blahy
 
-[ "IN: parser.tests USE: kernel TUPLE: blahy < tuple ; : blahy ; TUPLE: blahy < tuple ; : blahy ;" eval ]
+[ "IN: parser.tests USE: kernel TUPLE: blahy < tuple ; : blahy ( -- ) ; TUPLE: blahy < tuple ; : blahy ( -- ) ;" eval ]
 [ error>> error>> def>> \ blahy eq? ] must-fail-with
 
 [ ] [ f lexer set f file set "Hello world" note. ] unit-test
@@ -510,7 +506,7 @@ SYMBOLS: a b c ;
 
 DEFER: blah
 
-[ ] [ "IN: parser.tests GENERIC: blah" eval ] unit-test
+[ ] [ "IN: parser.tests GENERIC: blah ( -- )" eval ] unit-test
 [ ] [ "IN: parser.tests SYMBOLS: blah ;" eval ] unit-test
 
 [ f ] [ \ blah generic? ] unit-test
@@ -523,13 +519,13 @@ DEFER: blah1
 must-fail-with
 
 IN: qualified.tests.foo
-: x 1 ;
-: y 5 ;
+: x ( -- a ) 1 ;
+: y ( -- a ) 5 ;
 IN: qualified.tests.bar
-: x 2 ;
-: y 4 ;
+: x ( -- a ) 2 ;
+: y ( -- a ) 4 ;
 IN: qualified.tests.baz
-: x 3 ;
+: x ( -- a ) 3 ;
 
 QUALIFIED: qualified.tests.foo
 QUALIFIED: qualified.tests.bar
index 4241999bcd221c89f1faf620823575d85d187aa9..87531caee4c5107c65e24e6020960e404127dd01 100644 (file)
@@ -132,7 +132,7 @@ IN: vocabs.loader.tests
     "vocabs.loader.test.d" vocab source-loaded?>>
 ] unit-test
 
-: forget-junk
+: forget-junk ( -- )
     [
         { "2" "a" "b" "d" "e" "f" }
         [
index e4f1c02a3a0ef767f3fad96e2d0ac49d7b2c82ab..a07695f1c3691009144180636a32203b35715181 100644 (file)
@@ -1,3 +1,3 @@
 IN: vocabs.loader.test.d
 
-: foo iterate-next ;
\ No newline at end of file
+: foo ( -- ) iterate-next ;
\ No newline at end of file
index be16150c2e003931ca520ce4d337264709188d10..a141489a0fd7b1d919d13dfadb709d4260260c5d 100644 (file)
@@ -7,7 +7,7 @@ IN: advice.tests
 [
     [ ad-do-it ] must-fail
     
-    : foo "foo" ; 
+    : foo ( -- str ) "foo" ; 
     \ foo make-advised
  
     { "bar" "foo" } [
index 869158bf725cd30469c5bf6f5c857d5540011c83..ba3438e37d41751b3d3ad5b1bcadb3bd53e770ee 100755 (executable)
@@ -1,44 +1,45 @@
-USING: words kernel sequences locals locals.parser\r
-locals.definitions accessors parser namespaces continuations\r
-summary definitions generalizations arrays ;\r
-IN: descriptive\r
-\r
-ERROR: descriptive-error args underlying word ;\r
-\r
-M: descriptive-error summary\r
-    word>> "The " swap name>> " word encountered an error."\r
-    3append ;\r
-\r
-<PRIVATE\r
-: rethrower ( word inputs -- quot )\r
-    [ length ] keep [ [ narray ] dip swap 2array flip ] 2curry\r
-    [ 2 ndip descriptive-error ] 2curry ;\r
-\r
-: [descriptive] ( word def -- newdef )\r
-    swap dup "declared-effect" word-prop in>> rethrower\r
-    [ recover ] 2curry ;\r
-PRIVATE>\r
-\r
-: define-descriptive ( word def effect -- )\r
-    [ drop "descriptive-definition" set-word-prop ]\r
-    [ [ dupd [descriptive] ] dip define-declared ]\r
-    3bi ;\r
-\r
-SYNTAX: DESCRIPTIVE: (:) define-descriptive ;\r
-\r
-PREDICATE: descriptive < word\r
-    "descriptive-definition" word-prop ;\r
-\r
-M: descriptive definer drop \ DESCRIPTIVE: \ ; ;\r
-\r
-M: descriptive definition\r
-    "descriptive-definition" word-prop ;\r
-\r
-SYNTAX: DESCRIPTIVE:: (::) define-descriptive ;\r
-\r
-INTERSECTION: descriptive-lambda descriptive lambda-word ;\r
-\r
-M: descriptive-lambda definer drop \ DESCRIPTIVE:: \ ; ;\r
-\r
-M: descriptive-lambda definition\r
-    "lambda" word-prop body>> ;\r
+USING: words kernel sequences locals locals.parser
+locals.definitions accessors parser namespaces continuations
+summary definitions generalizations arrays ;
+IN: descriptive
+
+ERROR: descriptive-error args underlying word ;
+
+M: descriptive-error summary
+    word>> "The " swap name>> " word encountered an error."
+    3append ;
+
+<PRIVATE
+
+: rethrower ( word inputs -- quot )
+    [ length ] keep [ [ narray ] dip swap 2array flip ] 2curry
+    [ 2 ndip descriptive-error ] 2curry ;
+
+: [descriptive] ( word def effect -- newdef )
+    swapd in>> rethrower [ recover ] 2curry ;
+
+PRIVATE>
+
+: define-descriptive ( word def effect -- )
+    [ drop "descriptive-definition" set-word-prop ]
+    [ [ [ dup ] 2dip [descriptive] ] keep define-declared ]
+    3bi ;
+
+SYNTAX: DESCRIPTIVE: (:) define-descriptive ;
+
+PREDICATE: descriptive < word
+    "descriptive-definition" word-prop ;
+
+M: descriptive definer drop \ DESCRIPTIVE: \ ; ;
+
+M: descriptive definition
+    "descriptive-definition" word-prop ;
+
+SYNTAX: DESCRIPTIVE:: (::) define-descriptive ;
+
+INTERSECTION: descriptive-lambda descriptive lambda-word ;
+
+M: descriptive-lambda definer drop \ DESCRIPTIVE:: \ ; ;
+
+M: descriptive-lambda definition
+    "lambda" word-prop body>> ;
index 7e8e2dfcc97c2ecfa4342a3b0142cdea5c4cb87f..5e3d5d67cb6eb913c7469f60106154690258e84c 100644 (file)
@@ -31,8 +31,6 @@ IN: infix.tests
 [ f ] [ 2 \ gcd check-word ] unit-test ! multiple return values
 [ f ] [ 1 \ drop check-word ] unit-test ! no return value
 [ f ] [ 1 \ lcm check-word ] unit-test ! takes 2 args
-: no-stack-effect-declared + ;
-[ 0 \ no-stack-effect-declared check-word ] must-fail
 
 : qux ( -- x ) 2 ;
 [ t ] [ 0 \ qux check-word ] unit-test
index e2ca8816d9822a3ccb094aa50386cffecc721d18..70035f18546769168ee95181ffa24f5c9775ac44 100644 (file)
@@ -9,6 +9,6 @@ IN: lint.tests
 : lint2 ( n -- n' ) 1 + ; ! 1+
 [ { [ 1 + ] } ] [ \ lint2 lint ] unit-test
 
-: lint3 dup -rot ; ! tuck
+: lint3 ( a b -- b a b ) dup -rot ; ! tuck
 
 [ { { lint3 { [ dup -rot ] } } } ] [ \ lint3 lint-word ] unit-test
index 5b537c2621ba5777998440f42d7b7814cfc15609..1c11162a68370c0f7b0f28e4e4cfcf60f845bcce 100644 (file)
@@ -2,8 +2,7 @@ USING: kernel math math.functions tools.test math.analysis
 math.constants ;
 IN: math.analysis.tests
 
-: eps
-    .00000001 ;
+CONSTANT: eps .00000001
 
 [ t ] [ -9000000000000000000000000000000000000000000 gamma 1/0. = ] unit-test
 [ t ] [ -1.5 gamma 2.363271801207344 eps ~ ] unit-test
index 991551c00959915cd37bd6c7dcda4167d7231e94..91982de95cc33e5eb2da99079171e09dd7b4a9fa 100644 (file)
@@ -4,11 +4,11 @@ kernel strings ;
 
 [ { POSTPONE: f integer } ] [ { f integer } canonicalize-specializer-0 ] unit-test
 
-: setup-canon-test
+: setup-canon-test ( -- )
     0 args set
     V{ } clone hooks set ;
 
-: canon-test-1
+: canon-test-1 ( -- seq )
     { integer { cpu x86 } sequence } canonicalize-specializer-1 ;
 
 [ { { -2 integer } { -1 sequence } { cpu x86 } } ] [
@@ -36,12 +36,12 @@ kernel strings ;
     ] with-scope
 ] unit-test
 
-: example-1
+CONSTANT: example-1
     {
         { { { cpu x86 } { os linux } } "a" }
         { { { cpu ppc } } "b" }
         { { string { os windows } } "c" }
-    } ;
+    }
 
 [
     {
index f4bd0a00b224bcb973b949e23b0c2e9c0caedb1e..b6d732643fb8a5d2a587d8476e20633a8248bf9d 100644 (file)
@@ -1,7 +1,7 @@
 IN: multi-methods.tests
 USING: math strings sequences tools.test ;
 
-GENERIC: legacy-test
+GENERIC: legacy-test ( a -- b )
 
 M: integer legacy-test sq ;
 M: string legacy-test " hey" append ;
index 7ee5bd649f241863b3211b079910d624c54e9c8a..eed5540cb39490151cf9c09ab281408c958a923d 100644 (file)
@@ -3,7 +3,7 @@ USING: kernel accessors assocs
 sequences sequences.n-based tools.test ;
 IN: sequences.n-based.tests
 
-: months
+: months ( -- assoc )
     V{
         "January"
         "February"
index 932904eff40bcabecb522c9e2aaaca97d0a75843..71b30cd175fd1be468e29d15ecd5f579aae1bec7 100644 (file)
@@ -106,7 +106,7 @@ STRING: test-svg-string
 </svg>
 ;
 
-: test-svg-path
+: test-svg-path ( -- obj )
     test-svg-string string>xml body>> children-tags first ;
 
 [ { T{ moveto f { -1.0 -1.0 } f } T{ lineto f { 2.0 2.0 } t } } ]
index 9b450ed18bd7f1d4750f4b0feb36beda9f4f0838..96497b8bbc5c0cc8c2a992f3bc7af8a5c78ff2f7 100755 (executable)
@@ -15,7 +15,7 @@ IN: units.tests
 [ t ] [ 1 m 2 m 3 m 3array d-product 6 m^3 = ] unit-test
 [ t ] [ 3 m d-recip 1/3 { } { m } <dimensioned> = ] unit-test
 
-: km/L km 1 L d/ ;
-: mpg miles 1 gallons d/ ;
+: km/L ( n -- d ) km 1 L d/ ;
+: mpg ( n -- d ) miles 1 gallons d/ ;
 
 [ t ] [ 100 10 / km/L [ mpg ] undo 23 1 ~ ] unit-test