Comment 5 for bug 430672

Revision history for this message
Vincent Ladeuil (vila) wrote :

Yes we can !

class TestFullerMd(script.TestCaseWithTransportAndScript):

    def test_bug_430672(self):
        self.run_script("""
$ bzr init A
# Setup
$ cd A
$ bzr mkdir a
$ bzr ci -m '1'

# Add it
$ bzr mkdir a/b

# Both work
$ bzr mv a/b a/c
$ bzr mv a/c a/d

# This fails
$ bzr mv a/d a/a

# Show that we lost it.
$ bzr stat
""")

Note that we don't support the ';' and that empty lines are ignored, which may lead to
subtle bugs if we want to match empty output lines...so we have to treat empty lines
as expected output and use either '$ ' or '#' lines to replace them.

Also, using that kind of test brings the added benefit that they can be re-run (unlike the shell version
which miss a leading 'rm -fr A') and the 'A' directory isn't needed anymore.

And don't get me wrong, that's a very similar shell script that started me to write such shell scripts to reproduce
bugs (in particular the ability to reuse them with various versions of bzr) and gave me the clearer idea
that the above could be implemented (so take credit :).