Index: tests/phpunit/tests/link.php
===================================================================
--- tests/phpunit/tests/link.php	(revision 35485)
+++ tests/phpunit/tests/link.php	(working copy)
@@ -428,4 +428,23 @@
 
 		$this->assertSame( home_url( user_trailingslashit( $attachment->post_name ) ), get_permalink( $attachment_id ) );
 	}
+
+	/**
+	 * @ticket 2877
+	 */
+	function test_get_pagenum_link_firstpage_trailingslash() {
+		$old_req_uri = $_SERVER['REQUEST_URI'];
+
+		$this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%' );
+
+		add_filter( 'home_url', array( $this, '_get_pagenum_link_cb' ) );
+		$_SERVER['REQUEST_URI'] = '/woohoo';
+		$paged = get_pagenum_link( 1 );
+
+		remove_filter( 'home_url', array( $this, '_get_pagenum_link_cb' ) );
+		$this->assertEquals( home_url( '/WooHoo' ), $paged );
+
+		$_SERVER['REQUEST_URI'] = $old_req_uri;
+	}
+
 }
