diff --git a/extra/html/templates/chloe/test/test10.xml b/extra/html/templates/chloe/test/test10.xml deleted file mode 100644 index fd4a64ad0a..0000000000 --- a/extra/html/templates/chloe/test/test10.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - -
- -
diff --git a/extra/html/templates/chloe/test/test11.xml b/extra/html/templates/chloe/test/test11.xml deleted file mode 100644 index a9b2769445..0000000000 --- a/extra/html/templates/chloe/test/test11.xml +++ /dev/null @@ -1,3 +0,0 @@ - - -Hello diff --git a/extra/http/server/server-tests.factor b/extra/http/server/server-tests.factor deleted file mode 100755 index fb1abcc6e0..0000000000 --- a/extra/http/server/server-tests.factor +++ /dev/null @@ -1,167 +0,0 @@ -USING: http.server tools.test kernel namespaces accessors -io http math sequences assocs arrays classes words urls ; -IN: http.server.tests - -\ find-responder must-infer - -[ - - - "http" >>protocol - "www.apple.com" >>host - "/xxx/bar" >>path - { { "a" "b" } } >>query - >>url - request set - - [ ] link-hook set - - [ "http://www.apple.com:80/xxx/bar" ] [ - adjust-url url>string - ] unit-test - - [ "http://www.apple.com:80/xxx/baz" ] [ - "baz" >>path adjust-url url>string - ] unit-test - - [ "http://www.apple.com:80/xxx/baz?c=d" ] [ - "baz" >>path { { "c" "d" } } >>query adjust-url url>string - ] unit-test - - [ "http://www.apple.com:80/xxx/bar?c=d" ] [ - { { "c" "d" } } >>query adjust-url url>string - ] unit-test - - [ "http://www.apple.com:80/flip" ] [ - "/flip" >>path adjust-url url>string - ] unit-test - - [ "http://www.apple.com:80/flip?c=d" ] [ - "/flip" >>path { { "c" "d" } } >>query adjust-url url>string - ] unit-test - - [ "http://www.jedit.org:80/" ] [ - "http://www.jedit.org" >url adjust-url url>string - ] unit-test - - [ "http://www.jedit.org:80/?a=b" ] [ - "http://www.jedit.org" >url { { "a" "b" } } >>query adjust-url url>string - ] unit-test -] with-scope - -TUPLE: mock-responder path ; - -C: mock-responder - -M: mock-responder call-responder* - nip - path>> on - [ ] "text/plain" ; - -: check-dispatch ( tag path -- ? ) - H{ } clone base-paths set - over off - split-path - main-responder get call-responder - write-response get ; - -[ - - "foo" "foo" add-responder - "bar" "bar" add-responder - - "123" "123" add-responder - "default" >>default - "baz" add-responder - main-responder set - - [ "foo" ] [ - { "foo" } main-responder get find-responder path>> nip - ] unit-test - - [ "bar" ] [ - { "bar" } main-responder get find-responder path>> nip - ] unit-test - - [ t ] [ "foo" "foo" check-dispatch ] unit-test - [ f ] [ "foo" "bar" check-dispatch ] unit-test - [ t ] [ "bar" "bar" check-dispatch ] unit-test - [ t ] [ "default" "baz/xxx" check-dispatch ] unit-test - [ t ] [ "default" "baz/xxx//" check-dispatch ] unit-test - [ t ] [ "default" "/baz/xxx//" check-dispatch ] unit-test - [ t ] [ "123" "baz/123" check-dispatch ] unit-test - [ t ] [ "123" "baz///123" check-dispatch ] unit-test - -] with-scope - -[ - - "default" >>default - main-responder set - - [ "/default" ] [ "/default" main-responder get find-responder drop ] unit-test -] with-scope - -! Make sure path for default responder isn't chopped -TUPLE: path-check-responder ; - -C: path-check-responder - -M: path-check-responder call-responder* - drop - >array "text/plain" ; - -[ { "c" } ] [ - H{ } clone base-paths set - - { "b" "c" } - - - >>default - "b" add-responder - call-responder - body>> -] unit-test - -! Test that "" dispatcher works with default>> -[ ] [ - - "" "" add-responder - "bar" "bar" add-responder - "baz" >>default - main-responder set - - [ t ] [ "" "" check-dispatch ] unit-test - [ f ] [ "" "quux" check-dispatch ] unit-test - [ t ] [ "baz" "quux" check-dispatch ] unit-test - [ f ] [ "foo" "bar" check-dispatch ] unit-test - [ t ] [ "bar" "bar" check-dispatch ] unit-test - [ t ] [ "baz" "xxx" check-dispatch ] unit-test -] unit-test - -TUPLE: funny-dispatcher < dispatcher ; - -: funny-dispatcher new-dispatcher ; - -TUPLE: base-path-check-responder ; - -C: base-path-check-responder - -M: base-path-check-responder call-responder* - 2drop - "$funny-dispatcher" resolve-base-path - "text/plain" ; - -[ ] [ - - - - "c" add-responder - "b" add-responder - "a" add-responder - main-responder set -] unit-test - -[ "/a/b/" ] [ - "a/b/c" split-path main-responder get call-responder body>> -] unit-test diff --git a/extra/mime-types/mime.factor b/extra/mime-types/mime.factor deleted file mode 100755 index 894ed7dbc1..0000000000 --- a/extra/mime-types/mime.factor +++ /dev/null @@ -1,31 +0,0 @@ -! Copyright (C) 2004, 2008 Slava Pestov. -! See http://factorcode.org/license.txt for BSD license. -USING: io.files assocs kernel namespaces ; -IN: http.mime - -: mime-type ( filename -- mime-type ) - file-extension "mime-types" get at "application/octet-stream" or ; - -H{ - { "html" "text/html" } - { "txt" "text/plain" } - { "xml" "text/xml" } - { "css" "text/css" } - - { "gif" "image/gif" } - { "png" "image/png" } - { "jpg" "image/jpeg" } - { "jpeg" "image/jpeg" } - - { "jar" "application/octet-stream" } - { "zip" "application/octet-stream" } - { "tgz" "application/octet-stream" } - { "tar.gz" "application/octet-stream" } - { "gz" "application/octet-stream" } - - { "pdf" "application/pdf" } - - { "factor" "text/plain" } - { "cgi" "application/x-cgi-script" } - { "fhtml" "application/x-factor-server-page" } -} "mime-types" set-global