diff --git a/core/io/encodings/utf8/utf8-tests.factor b/core/io/encodings/utf8/utf8-tests.factor index 25eae5ae22..af169854c9 100755 --- a/core/io/encodings/utf8/utf8-tests.factor +++ b/core/io/encodings/utf8/utf8-tests.factor @@ -1,4 +1,5 @@ USING: io.encodings.utf8 tools.test io.encodings.string strings arrays unicode ; +IN: io.encodings.utf8.tests : decode-utf8-w/stream ( array -- newarray ) utf8 decode >array ; diff --git a/extra/bitfields/bitfields-tests.factor b/extra/bitfields/bitfields-tests.factor old mode 100644 new mode 100755 index 8a3bb1f043..bbd4aa3db0 --- a/extra/bitfields/bitfields-tests.factor +++ b/extra/bitfields/bitfields-tests.factor @@ -1,4 +1,5 @@ USING: tools.test bitfields kernel ; +IN: bitfields.tests SAFE-BITFIELD: foo bar:5 baz:10 111 bing:2 ; diff --git a/extra/calendar/calendar-tests.factor b/extra/calendar/calendar-tests.factor index f700d244f5..1041c79691 100755 --- a/extra/calendar/calendar-tests.factor +++ b/extra/calendar/calendar-tests.factor @@ -1,5 +1,6 @@ USING: arrays calendar kernel math sequences tools.test continuations system ; +IN: calendar.tests [ f ] [ 2004 12 32 0 0 0 0 valid-timestamp? ] unit-test [ f ] [ 2004 2 30 0 0 0 0 valid-timestamp? ] unit-test diff --git a/extra/db/sqlite/sqlite.factor b/extra/db/sqlite/sqlite.factor index 2fb62bf656..b72d788605 100755 --- a/extra/db/sqlite/sqlite.factor +++ b/extra/db/sqlite/sqlite.factor @@ -1,10 +1,10 @@ ! Copyright (C) 2005, 2008 Chris Double, Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. USING: alien arrays assocs classes compiler db -hashtables io.files io.files.tmp kernel math math.parser namespaces +hashtables io.files kernel math math.parser namespaces prettyprint sequences strings tuples alien.c-types continuations db.sqlite.lib db.sqlite.ffi db.tuples -words combinators.lib db.types combinators tools.walker +words combinators.lib db.types combinators combinators.cleave io namespaces.lib ; IN: db.sqlite @@ -25,11 +25,6 @@ M: sqlite-db dispose ( db -- ) dispose-db ; : with-sqlite ( path quot -- ) sqlite-db swap with-db ; inline -: with-tmp-sqlite ( quot -- ) - ".db" [ - swap with-sqlite - ] with-tmpfile ; - TUPLE: sqlite-statement ; TUPLE: sqlite-result-set has-more? ; diff --git a/extra/hash2/hash2-tests.factor b/extra/hash2/hash2-tests.factor old mode 100644 new mode 100755 index b7a4f42ac5..f3c17bb04b --- a/extra/hash2/hash2-tests.factor +++ b/extra/hash2/hash2-tests.factor @@ -1,4 +1,5 @@ USING: tools.test hash2 kernel ; +IN: hash2.tests : sample-hash 5 diff --git a/extra/ldap/ldap-tests.factor b/extra/ldap/ldap-tests.factor old mode 100644 new mode 100755 index 42e51c782a..14029706e5 --- a/extra/ldap/ldap-tests.factor +++ b/extra/ldap/ldap-tests.factor @@ -1,57 +1,58 @@ -USING: alien alien.c-types io kernel ldap ldap.libldap namespaces prettyprint -tools.test ; +USING: alien alien.c-types io kernel ldap ldap.libldap +namespaces prettyprint tools.test ; +IN: ldap.tests "void*" "ldap://localhost:389" initialize get-ldp LDAP_OPT_PROTOCOL_VERSION LDAP_VERSION3 set-option -[ 3 ] [ +[ 3 ] [ get-ldp LDAP_OPT_PROTOCOL_VERSION "int*" [ get-option ] keep *int ] unit-test [ -get-ldp "cn=jimbob,dc=example,dc=com" "secret" [ + get-ldp "cn=jimbob,dc=example,dc=com" "secret" [ - ! get-ldp "dc=example,dc=com" LDAP_SCOPE_ONELEVEL "(objectclass=*)" f 0 - ! "void*" [ search-s ] keep *int . + ! get-ldp "dc=example,dc=com" LDAP_SCOPE_ONELEVEL "(objectclass=*)" f 0 + ! "void*" [ search-s ] keep *int . - [ 2 ] [ - get-ldp "dc=example,dc=com" LDAP_SCOPE_SUBTREE "(objectclass=*)" f 0 - search - ] unit-test + [ 2 ] [ + get-ldp "dc=example,dc=com" LDAP_SCOPE_SUBTREE "(objectclass=*)" f 0 + search + ] unit-test - ! get-ldp LDAP_RES_ANY 0 f "void*" result . + ! get-ldp LDAP_RES_ANY 0 f "void*" result . - get-ldp LDAP_RES_ANY LDAP_MSG_ALL f "void*" result + get-ldp LDAP_RES_ANY LDAP_MSG_ALL f "void*" result - ! get-message *int . + ! get-message *int . - "Message ID: " write + "Message ID: " write - get-message msgid . + get-message msgid . - get-ldp get-message get-dn . + get-ldp get-message get-dn . - "Entries count: " write + "Entries count: " write - get-ldp get-message count-entries . + get-ldp get-message count-entries . - SYMBOL: entry - SYMBOL: attr + SYMBOL: entry + SYMBOL: attr - "Attribute: " write + "Attribute: " write - get-ldp get-message first-entry entry set get-ldp entry get - "void*" first-attribute dup . attr set + get-ldp get-message first-entry entry set get-ldp entry get + "void*" first-attribute dup . attr set - "Value: " write + "Value: " write - get-ldp entry get attr get get-values *char* . + get-ldp entry get attr get get-values *char* . - get-ldp get-message first-message msgtype result-type + get-ldp get-message first-message msgtype result-type - get-ldp get-message next-message msgtype result-type + get-ldp get-message next-message msgtype result-type -] with-bind + ] with-bind ] drop diff --git a/extra/multiline/multiline-tests.factor b/extra/multiline/multiline-tests.factor old mode 100644 new mode 100755 index a9b9ee2322..c323e9b96a --- a/extra/multiline/multiline-tests.factor +++ b/extra/multiline/multiline-tests.factor @@ -1,4 +1,5 @@ USING: multiline tools.test ; +IN: multiline.tests STRING: test-it foo diff --git a/extra/pdf/pdf-tests.factor b/extra/pdf/pdf-tests.factor old mode 100644 new mode 100755 index 097f671d9a..290773a89d --- a/extra/pdf/pdf-tests.factor +++ b/extra/pdf/pdf-tests.factor @@ -1,4 +1,5 @@ USING: io.files kernel math namespaces pdf pdf.libhpdf prettyprint sequences ; +IN: pdf.tests SYMBOL: font diff --git a/extra/rss/rss-tests.factor b/extra/rss/rss-tests.factor old mode 100644 new mode 100755 index 1d493d3c14..77364d73e7 --- a/extra/rss/rss-tests.factor +++ b/extra/rss/rss-tests.factor @@ -1,4 +1,5 @@ USING: rss io kernel io.files tools.test io.encodings.utf8 ; +IN: rss.tests : load-news-file ( filename -- feed ) #! Load an news syndication file and process it, returning diff --git a/extra/sequences/deep/deep-tests.factor b/extra/sequences/deep/deep-tests.factor old mode 100644 new mode 100755 index 9c02d52089..541570f3f9 --- a/extra/sequences/deep/deep-tests.factor +++ b/extra/sequences/deep/deep-tests.factor @@ -1,5 +1,6 @@ USING: sequences.deep kernel tools.test strings math arrays namespaces sequences ; +IN: sequences.deep.tests [ [ "hello" 3 4 swap ] ] [ [ { "hello" V{ 3 4 } } swap ] flatten ] unit-test diff --git a/extra/tuple-arrays/tuple-arrays-tests.factor b/extra/tuple-arrays/tuple-arrays-tests.factor old mode 100644 new mode 100755 index dfe9002bb9..dd9510405f --- a/extra/tuple-arrays/tuple-arrays-tests.factor +++ b/extra/tuple-arrays/tuple-arrays-tests.factor @@ -1,4 +1,5 @@ USING: tuple-arrays sequences tools.test namespaces kernel math ; +IN: tuple-arrays.tests SYMBOL: mat TUPLE: foo bar ; diff --git a/extra/xml/tests/errors.factor b/extra/xml/tests/errors.factor old mode 100644 new mode 100755 index c0a60d8a3f..b421ae011a --- a/extra/xml/tests/errors.factor +++ b/extra/xml/tests/errors.factor @@ -1,4 +1,5 @@ USING: continuations xml xml.errors tools.test kernel arrays xml.data state-parser quotations ; +IN: xml.tests : xml-error-test ( expected-error xml-string -- ) [ string>xml ] curry swap [ = ] curry must-fail-with ; diff --git a/extra/xmode/tokens/tokens.factor b/extra/xmode/tokens/tokens.factor old mode 100644 new mode 100755 index e1fa2dd04f..7b913cbac0 --- a/extra/xmode/tokens/tokens.factor +++ b/extra/xmode/tokens/tokens.factor @@ -5,12 +5,12 @@ IN: xmode.tokens ! Based on org.gjt.sp.jedit.syntax.Token SYMBOL: tokens -[ - { "COMMENT1" "COMMENT2" "COMMENT3" "COMMENT4" "DIGIT" "FUNCTION" "INVALID" "KEYWORD1" "KEYWORD2" "KEYWORD3" "KEYWORD4" "LABEL" "LITERAL1" "LITERAL2" "LITERAL3" "LITERAL4" "MARKUP" "OPERATOR" "END" "NULL" } [ - create-in dup define-symbol - dup word-name swap - ] H{ } map>assoc tokens set-global -] with-compilation-unit +<< +{ "COMMENT1" "COMMENT2" "COMMENT3" "COMMENT4" "DIGIT" "FUNCTION" "INVALID" "KEYWORD1" "KEYWORD2" "KEYWORD3" "KEYWORD4" "LABEL" "LITERAL1" "LITERAL2" "LITERAL3" "LITERAL4" "MARKUP" "OPERATOR" "END" "NULL" } [ + create-in dup define-symbol + dup word-name swap +] H{ } map>assoc tokens set-global +>> : string>token ( string -- id ) tokens get at ;