view tests/test-hg-parseurl.py @ 26842:0f76c64f5cc3

testing: add hypothesis fuzz testing Hypothesis a library for adding fuzzing over a range of structure data to your test suite: http://hypothesis.readthedocs.org/en/latest/ This adds the ability to build tests using Hypothesis within the Mercurial test suite. New tests and fixes using this helpers comes in later changesets.
author David R. MacIver <david@drmaciver.com>
date Sat, 24 Oct 2015 12:46:03 +0100
parents 375872fdadba
children 8a23f88131c3
line wrap: on
line source

from mercurial.hg import parseurl

def testparse(url, branch=[]):
    print '%s, branches: %r' % parseurl(url, branch)

testparse('http://example.com/no/anchor')
testparse('http://example.com/an/anchor#foo')
testparse('http://example.com/no/anchor/branches', branch=['foo'])
testparse('http://example.com/an/anchor/branches#bar', branch=['foo'])
testparse('http://example.com/an/anchor/branches-None#foo', branch=None)
testparse('http://example.com/')
testparse('http://example.com')
testparse('http://example.com#foo')