diff --git a/core/modules/path/path.test b/core/modules/path/path.test
index 8f0406e..aba4b4d 100644
--- a/core/modules/path/path.test
+++ b/core/modules/path/path.test
@@ -104,6 +104,16 @@ class PathTestCase extends DrupalWebTestCase {
     $this->drupalGet($edit['alias']);
     $this->assertNoText($node1->title, 'Alias was successfully deleted.');
     $this->assertResponse(404);
+
+    // Create an alias with slashes at either end.
+    $edit = array();
+    $alias_with_slashes = '/'. $this->randomName(8) . '/';
+    $edit['alias'] = $alias_with_slashes;
+    $edit['source'] = 'node/' . $node1->nid;
+    $this->drupalPost('admin/config/search/path/add', $edit, t('Save'));
+    $this->drupalGet($alias_with_slashes);
+    $this->assertResponse(200, 'Alias with leading and trailing slashes is trimmed.');
+    $this->assertText($node1->title, 'Alias with leading and trailing slashes is saved.');
   }
 
   /**
@@ -157,6 +167,15 @@ class PathTestCase extends DrupalWebTestCase {
     $this->drupalGet($edit['path[alias]']);
     $this->assertNoText($node1->title, 'Alias was successfully deleted.');
     $this->assertResponse(404);
+
+    // Create an alias with slashes at either end.
+    $edit = array();
+    $alias_with_slashes = '/'. $this->randomName(8) . '/';
+    $edit['path[alias]'] = $alias_with_slashes;
+    $this->drupalPost('node/' . $node1->nid . '/edit', $edit, t('Save'));
+    $this->drupalGet($alias_with_slashes);
+    $this->assertResponse(200, 'Alias with leading and trailing slashes is trimmed.');
+    $this->assertText($node1->title, 'Alias with leading and trailing slashes is saved.');
   }
 
   function getPID($alias) {
@@ -225,6 +244,15 @@ class PathTaxonomyTermTestCase extends DrupalWebTestCase {
     $this->drupalGet($edit2['path[alias]']);
     $this->assertNoText($description, 'Old URL alias has been removed after altering.');
     $this->assertResponse(404, 'Old URL alias returns 404.');
+
+    // Create an alias with slashes at either end.
+    $edit = array();
+    $alias_with_slashes = '/'. $this->randomName(8) . '/';
+    $edit['path[alias]'] = $alias_with_slashes;
+    $this->drupalPost('taxonomy/term/' . $tid . '/edit', $edit, t('Save'));
+    $this->drupalGet($alias_with_slashes);
+    $this->assertResponse(200, 'Alias with leading and trailing slashes is trimmed.');
+    $this->assertText($description, 'Alias with leading and trailing slashes is saved.');
   }
 }
 
