[pypy-svn] r56047 - in pypy/build/bot: . test

fijal at codespeak.net fijal at codespeak.net
Tue Jun 24 03:45:57 CEST 2008


Author: fijal
Date: Tue Jun 24 03:45:55 2008
New Revision: 56047

Added:
   pypy/build/bot/test/test_netstring.py   (contents, props changed)
Modified:
   pypy/build/bot/netstring.py
Log:
Move netstring's tests into it's own test file. It'll go away at some
point anyway


Modified: pypy/build/bot/netstring.py
==============================================================================
--- pypy/build/bot/netstring.py	(original)
+++ pypy/build/bot/netstring.py	Tue Jun 24 03:45:55 2008
@@ -14,9 +14,3 @@
         length = int(netstrings[position:lengthEnd])
         yield netstrings[lengthEnd + 1:lengthEnd + 1 + length]
         position = lengthEnd + length + 2
-
-input = "\n1:x\n2:ab\n3:123\n3:\nxy\n4:a\nb\n\n1:a\n"
-output = ["x", "ab", "123", "\nxy", "a\nb\n", "a"]
-assert map(str, netstringparser(input)) == output
-input = input.replace('\n', '\r\n')
-assert map(str, netstringparser(input)) == output

Added: pypy/build/bot/test/test_netstring.py
==============================================================================
--- (empty file)
+++ pypy/build/bot/test/test_netstring.py	Tue Jun 24 03:45:55 2008
@@ -0,0 +1,9 @@
+
+from bot.netstring import netstringparser
+
+def test_netstring():
+    input = "\n1:x\n2:ab\n3:123\n3:\nxy\n4:a\nb\n\n1:a\n"
+    output = ["x", "ab", "123", "\nxy", "a\nb\n", "a"]
+    assert map(str, netstringparser(input)) == output
+    input = input.replace('\n', '\r\n')
+    assert map(str, netstringparser(input)) == output



More information about the Pypy-commit mailing list