Rev 361: Add special character tests. in http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev

Jelmer Vernooij jelmer at samba.org
Tue Jan 2 05:46:22 GMT 2007


------------------------------------------------------------
revno: 361
revision-id: jelmer at samba.org-20070102054543-veht1jei7cpx63tw
parent: jelmer at samba.org-20070102023936-utvizor7j13a0rze
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Tue 2007-01-02 06:45:43 +0100
message:
  Add special character tests.
modified:
  tests/test_fileids.py          test_fileids.py-20060622131341-19gyrlgqy8yl2od5-1
  tests/test_repos.py            test_repos.py-20060508151940-ddc49a59257ca712
=== modified file 'tests/test_fileids.py'
--- a/tests/test_fileids.py	2007-01-01 22:18:53 +0000
+++ b/tests/test_fileids.py	2007-01-02 05:45:43 +0000
@@ -162,6 +162,10 @@
         self.assertEqual("svn-v2:2 at uuid-bp-" + sha1(dir) + "-filename", 
                          generate_file_id("svn-v2:2 at uuid-bp", dir+"filename"))
 
+    def test_generate_file_id_special_char(self):
+        self.assertEqual(u"svn-v2:2 at uuid-bp-mypath\x2c", 
+                         generate_file_id("svn-v2:2 at uuid-bp", u"mypath\x2c"))
+
 class TestFileMapping(TestCase):
     def apply_mappings(self, mappings, find_children=None, renames={}):
         map = {}

=== modified file 'tests/test_repos.py'
--- a/tests/test_repos.py	2007-01-02 02:39:36 +0000
+++ b/tests/test_repos.py	2007-01-02 05:45:43 +0000
@@ -532,6 +532,17 @@
         newrepos = dir.create_repository()
         oldrepos.copy_content_into(newrepos)
 
+    def test_fetch_special_char(self):
+        repos_url = self.make_client('d', 'dc')
+        self.build_tree({u'dc/trunk/f\x2cle': "data"})
+        self.client_add("dc/trunk")
+        self.client_commit("dc", "My Message")
+        oldrepos = Repository.open(repos_url)
+        oldrepos.set_branching_scheme(TrunkBranchingScheme(1))
+        dir = BzrDir.create("f")
+        newrepos = dir.create_repository()
+        oldrepos.copy_content_into(newrepos)
+
     def test_fetch_delete(self):
         repos_url = self.make_client('d', 'dc')
         self.build_tree({'dc/foo/bla': "data"})
@@ -1813,20 +1824,30 @@
     def test_generate_revid(self):
         self.assertEqual("svn-v%d:5 at myuuid-branch" % MAPPING_VERSION, 
                          generate_svn_revision_id("myuuid", 5, "branch"))
+
+    def test_generate_revid_nested(self):
         self.assertEqual("svn-v%d:5 at myuuid-branch%%2fpath" % MAPPING_VERSION, 
                          generate_svn_revision_id("myuuid", 5, "branch/path"))
 
-    def test_parse_revid(self):
+    def test_generate_revid_special_char(self):
+        self.assertEqual(u"svn-v%d:5 at myuuid-branch\x2c" % MAPPING_VERSION, 
+                         generate_svn_revision_id("myuuid", 5, u"branch\x2c"))
+
+    def test_parse_revid_simple(self):
         self.assertEqual(("uuid", "", 4),
                          parse_svn_revision_id(
                              "svn-v%d:4 at uuid-" % MAPPING_VERSION))
+
+    def test_parse_revid_nested(self):
         self.assertEqual(("uuid", "bp/data", 4),
                          parse_svn_revision_id(
                              "svn-v%d:4 at uuid-bp%%2fdata" % MAPPING_VERSION))
 
-    def test_svk_revid_map(self):
+    def test_svk_revid_map_root(self):
         self.assertEqual("svn-v%d:6 at auuid-" % MAPPING_VERSION,
                          svk_feature_to_revision_id("auuid:/:6"))
+
+    def test_svk_revid_map_nested(self):
         self.assertEqual("svn-v%d:6 at auuid-bp" % MAPPING_VERSION,
                          svk_feature_to_revision_id("auuid:/bp:6"))
 




More information about the bazaar-commits mailing list