]> gitweb.factorcode.org Git - factor.git/commitdiff
More unit test fixes
authorSlava Pestov <slava@factorcode.org>
Sat, 8 Mar 2008 10:27:19 +0000 (04:27 -0600)
committerSlava Pestov <slava@factorcode.org>
Sat, 8 Mar 2008 10:27:19 +0000 (04:27 -0600)
13 files changed:
core/io/encodings/utf8/utf8-tests.factor
extra/bitfields/bitfields-tests.factor [changed mode: 0644->0755]
extra/calendar/calendar-tests.factor
extra/db/sqlite/sqlite.factor
extra/hash2/hash2-tests.factor [changed mode: 0644->0755]
extra/ldap/ldap-tests.factor [changed mode: 0644->0755]
extra/multiline/multiline-tests.factor [changed mode: 0644->0755]
extra/pdf/pdf-tests.factor [changed mode: 0644->0755]
extra/rss/rss-tests.factor [changed mode: 0644->0755]
extra/sequences/deep/deep-tests.factor [changed mode: 0644->0755]
extra/tuple-arrays/tuple-arrays-tests.factor [changed mode: 0644->0755]
extra/xml/tests/errors.factor [changed mode: 0644->0755]
extra/xmode/tokens/tokens.factor [changed mode: 0644->0755]

index 25eae5ae22b4d9c3e201543428969e2b3c0e4692..af169854c9017ae71091d9cd198f8baa86c925e3 100755 (executable)
@@ -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 ;
old mode 100644 (file)
new mode 100755 (executable)
index 8a3bb1f..bbd4aa3
@@ -1,4 +1,5 @@
 USING: tools.test bitfields kernel ;
+IN: bitfields.tests
 
 SAFE-BITFIELD: foo bar:5 baz:10 111 bing:2 ;
 
index f700d244f5e5f70f81b801b9dbf370694abda166..1041c79691f239f97ea4b1333c5b5c2a6c486e1d 100755 (executable)
@@ -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 <timestamp> valid-timestamp? ] unit-test
 [ f ] [ 2004  2 30 0   0  0 0 <timestamp> valid-timestamp? ] unit-test
index 2fb62bf65643895c0f7f5b41229c3899193b8ad6..b72d7886052ab05386257ffd5e91c6f8aa52df6a 100755 (executable)
@@ -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? ;
old mode 100644 (file)
new mode 100755 (executable)
index b7a4f42..f3c17bb
@@ -1,4 +1,5 @@
 USING: tools.test hash2 kernel ;
+IN: hash2.tests
 
 : sample-hash
     5 <hash2>
old mode 100644 (file)
new mode 100755 (executable)
index 42e51c7..1402970
@@ -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*" <c-object> "ldap://localhost:389" initialize
 
 get-ldp LDAP_OPT_PROTOCOL_VERSION LDAP_VERSION3 <int> set-option
 
-[ 3 ] [ 
+[ 3 ] [
     get-ldp LDAP_OPT_PROTOCOL_VERSION "int*" <c-object> [ 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*" <c-object> [ search-s ] keep *int .
+        ! get-ldp "dc=example,dc=com" LDAP_SCOPE_ONELEVEL "(objectclass=*)" f 0
+        ! "void*" <c-object> [ 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*" <c-object> result .
+        ! get-ldp LDAP_RES_ANY 0 f "void*" <c-object> result .
 
-    get-ldp LDAP_RES_ANY LDAP_MSG_ALL f "void*" <c-object> result
+        get-ldp LDAP_RES_ANY LDAP_MSG_ALL f "void*" <c-object> 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*" <c-object> first-attribute dup . attr set
+        get-ldp get-message first-entry entry set get-ldp entry get
+        "void*" <c-object> 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
old mode 100644 (file)
new mode 100755 (executable)
index a9b9ee2..c323e9b
@@ -1,4 +1,5 @@
 USING: multiline tools.test ;
+IN: multiline.tests
 
 STRING: test-it
 foo
old mode 100644 (file)
new mode 100755 (executable)
index 097f671..290773a
@@ -1,4 +1,5 @@
 USING: io.files kernel math namespaces pdf pdf.libhpdf prettyprint sequences ;
+IN: pdf.tests
 
 SYMBOL: font
 
old mode 100644 (file)
new mode 100755 (executable)
index 1d493d3..77364d7
@@ -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
old mode 100644 (file)
new mode 100755 (executable)
index 9c02d52..541570f
@@ -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
 
old mode 100644 (file)
new mode 100755 (executable)
index dfe9002..dd95104
@@ -1,4 +1,5 @@
 USING: tuple-arrays sequences tools.test namespaces kernel math ;
+IN: tuple-arrays.tests
 
 SYMBOL: mat
 TUPLE: foo bar ;
old mode 100644 (file)
new mode 100755 (executable)
index c0a60d8..b421ae0
@@ -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 ;
old mode 100644 (file)
new mode 100755 (executable)
index e1fa2dd..7b913cb
@@ -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 ;