ftphs 1.0.5 → 1.0.6
raw patch · 5 files changed
+139/−4 lines, 5 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- Makefile +36/−0
- examples/ftptest.hs +16/−0
- ftphs.cabal +7/−4
- testsrc/Network/FTP/Parsertest.hs +52/−0
- testsrc/Tests.hs +28/−0
+ Makefile view
@@ -0,0 +1,36 @@+all: setup+ @echo "Please use Cabal to build this package; not make."+ ./setup configure+ ./setup build++setup: Setup.hs+ ghc --make -package Cabal -o setup Setup.hs++install: setup+ ./setup install++clean:+ -runghc Setup.hs clean+ -rm -rf html `find . -name "*.o"` `find . -name "*.hi" | grep -v debian` \+ `find . -name "*~" | grep -v debian` *.a setup dist testsrc/runtests \+ local-pkg doctmp+ -rm -rf testtmp/* testtmp*++.PHONY: test+test: test-ghc test-hugs+ @echo ""+ @echo "All tests pass."++test-hugs: setup+ @echo " ****** Running hugs tests"+ ./setup configure -f buildtests --hugs --extra-include-dirs=/usr/lib/hugs/include+ ./setup build+ runhugs -98 +o -P$(PWD)/dist/scratch:$(PWD)/dist/scratch/programs/runtests: \+ dist/scratch/programs/runtests/Main.hs++test-ghc: setup+ @echo " ****** Building GHC tests"+ ./setup configure -f buildtests+ ./setup build+ @echo " ****** Running GHC tests"+ ./dist/build/runtests/runtests
+ examples/ftptest.hs view
@@ -0,0 +1,16 @@+-- arch-tag: FTP test+import MissingH.Network.FTP.Server+import MissingH.Network.SocketServer+import MissingH.Logging.Logger+import MissingH.IO.HVFS+import MissingH.IO.HVFS.Combinators++main = do+ updateGlobalLogger "" (setLevel DEBUG)+ updateGlobalLogger "MissingH.Network.FTP.Server" (setLevel DEBUG)+ let opts = (simpleTCPOptions 12345) {reuse = True}+ serveTCPforever opts $+ threadedHandler $ + loggingHandler "" INFO $+ handleHandler $+ anonFtpHandler (HVFSReadOnly SystemFS)
ftphs.cabal view
@@ -1,12 +1,14 @@ Name: ftphs-Version: 1.0.5+Version: 1.0.6 License: LGPL Maintainer: John Goerzen <jgoerzen@complete.org> Author: John Goerzen Stability: Stable-Copyright: Copyright (c) 2004-2008 John Goerzen+Copyright: Copyright (c) 2004-2010 John Goerzen license-file: COPYRIGHT-extra-source-files: COPYING+extra-source-files: COPYING,+ Makefile,+ examples/ftptest.hs Homepage: http://software.complete.org/ftphs Category: Network Synopsis: FTP Client and Server Library@@ -36,7 +38,7 @@ Network.FTP.Server.Parser Extensions: ExistentialQuantification, OverlappingInstances, UndecidableInstances, CPP- Build-Depends: network, parsec, base,+ Build-Depends: network, parsec, base >= 3 && < 5, haskell98, mtl, regex-compat, hslogger, MissingH>=1.0.0 GHC-Options: -O2@@ -48,6 +50,7 @@ else Buildable: False Main-Is: runtests.hs+ Other-Modules: Tests, Network.FTP.Parsertest HS-Source-Dirs: testsrc, src, . Extensions: ExistentialQuantification, OverlappingInstances, UndecidableInstances, CPP
+ testsrc/Network/FTP/Parsertest.hs view
@@ -0,0 +1,52 @@+{- arch-tag: Network.Utils.FTP.Parser tests main file+Copyright (C) 2004 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA+-}++module Network.FTP.Parsertest(tests) where+import Test.HUnit+import Network.FTP.Client.Parser+import Test.HUnit.Tools+import Network.Socket++test_parseReply =+ let f inp exp = exp @=? parseReply inp in+ do+ f "200 Welcome to this server.\r\n" (200, ["Welcome to this server."])+ f "230-Foo\r\n230 Foo2\r\n" (230, ["Foo", "Foo2"])+ f "240-Foo\r\n240-Foo2\r\n240 Foo3\r\n" (240, ["Foo", "240-Foo2", "Foo3"])+ f "230-Test\r\nLine2\r\n 230 Line3\r\n230 Done\r\n"+ (230, ["Test", "Line2", " 230 Line3", "Done"])++{-+test_toPortString =+ let f inp exp = exp @=? toPortString inp in+ do+ f (SockAddrInet (PortNum 0x1234) 0xaabbccdd) "170,187,204,221,18,52"++test_fromPortString =+ let f inp exp = exp @=? case fromPortString inp of+ SockAddrInet (PortNum x) y -> (x, y)+ _ -> (0, 0)+ in+ do+ f "170,187,204,221,18,52" (0x1234, 0xaabbccdd)+-}+tests = TestList [TestLabel "parseReply" (TestCase test_parseReply)+ --TestLabel "toPortString" (TestCase test_toPortString),+ --TestLabel "fromPortString" (TestCase test_fromPortString)++ ]
+ testsrc/Tests.hs view
@@ -0,0 +1,28 @@+{- arch-tag: Tests main file+Copyright (C) 2004 John Goerzen <jgoerzen@complete.org>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA+-}++module Tests(tests) where+import Test.HUnit+import qualified Network.FTP.Parsertest++test1 = TestCase ("x" @=? "x")++tests = TestList [TestLabel "test1" test1,+ TestLabel "Network.FTP.Parser" Network.FTP.Parsertest.tests]++