diff tests/doctest.txt @ 2:20dde2687cfb

stub doctests
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 16 Jun 2011 17:59:29 -0700
parents
children 6b99523536ee
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/doctest.txt	Thu Jun 16 17:59:29 2011 -0700
@@ -0,0 +1,23 @@
+Test urlmatch
+=============
+
+The obligatory imports::
+
+    >>> from urlmatcher import UrlMatcher
+
+Test matching::
+
+    >>> matcher = UrlMatcher('http://www.example.com/foo/bar/fleem')
+    >>> matcher.add('http://www.example.com/foo/blah')
+    >>> matcher.add('https://www.example.com/foo/')
+    >>> matcher.add('https://www.example.net/foo/')
+    >>> sorted(matcher.match('example.com/foo/bar'))
+    ['http://www.example.com/foo/bar/fleem', ]
+    >>> sorted(matcher.match('http://example.com/foo'))
+    >>> sorted(matcher.match('example.com'))
+    >>> sorted(matcher.match('example'))
+
+
+Test url diffs::
+
+    >>> matcher = urlmatcher()