@@ -382,6 +382,50 @@ public virtual void UriResolverTest18() {
382382 NUnit . Framework . Assert . IsFalse ( resolver . IsLocalBaseUri ( ) ) ;
383383 }
384384
385+ [ NUnit . Framework . Test ]
386+ public void SingleQuoteRelativePath ( ) {
387+ String expectedUrl = "https://he.wikipedia.org/wiki/%D7%90%D7%91%D7%92'%D7%93" ;
388+ String baseUri = "https://he.wikipedia.org/wiki/" ;
389+ String relativePath = "%D7%90%D7%91%D7%92'%D7%93" ;
390+ UriResolver resolver = new UriResolver ( baseUri ) ;
391+
392+ NUnit . Framework . Assert . AreEqual ( expectedUrl , resolver . ResolveAgainstBaseUri ( relativePath ) . ToExternalForm ( ) ) ;
393+ }
394+
395+ [ NUnit . Framework . Test ]
396+ [ NUnit . Framework . Ignore ( "DEVSIX-2880: single quote character isn't encoded in Java and .NET 4.0, but it's encoded in .NETCoreApp 1.0" +
397+ " from single quote to %27" ) ]
398+ public void quoteInPercentsRelativePath ( ) {
399+ String expectedUrl = "https://he.wikipedia.org/wiki/%D7%90%D7%91%D7%92%27%D7%93" ;
400+ String baseUri = "https://he.wikipedia.org/wiki/" ;
401+ String relativePath = "%D7%90%D7%91%D7%92%27%D7%93" ;
402+ UriResolver resolver = new UriResolver ( baseUri ) ;
403+
404+ NUnit . Framework . Assert . AreEqual ( expectedUrl , resolver . ResolveAgainstBaseUri ( relativePath ) . ToExternalForm ( ) ) ;
405+ }
406+
407+ [ NUnit . Framework . Test ]
408+ public void singleQuoteBasePath ( ) {
409+ String expectedUrl = "https://he.wikipedia.org/wiki'/%D7%90%D7%91%D7%92%D7%93" ;
410+ String baseUri = "https://he.wikipedia.org/wiki'/" ;
411+ String relativePath = "%D7%90%D7%91%D7%92%D7%93" ;
412+ UriResolver resolver = new UriResolver ( baseUri ) ;
413+
414+ NUnit . Framework . Assert . AreEqual ( expectedUrl , resolver . ResolveAgainstBaseUri ( relativePath ) . ToExternalForm ( ) ) ;
415+ }
416+
417+ [ NUnit . Framework . Test ]
418+ [ NUnit . Framework . Ignore ( "DEVSIX-2880: single quote character isn't encoded in Java and .NET 4.0, but it's encoded in .NETCoreApp 1.0" +
419+ " from single quote to %27" ) ]
420+ public void quoteInPercentsBasePath ( ) {
421+ String expectedUrl = "https://he.wikipedia.org/wiki%27/%D7%90%D7%91%D7%92%D7%93" ;
422+ String baseUri = "https://he.wikipedia.org/wiki%27/" ;
423+ String relativePath = "%D7%90%D7%91%D7%92%D7%93" ;
424+ UriResolver resolver = new UriResolver ( baseUri ) ;
425+
426+ NUnit . Framework . Assert . AreEqual ( expectedUrl , resolver . ResolveAgainstBaseUri ( relativePath ) . ToExternalForm ( ) ) ;
427+ }
428+
385429 private void TestPaths ( String absolutePathRoot , UriResolver resolver )
386430 {
387431 NUnit . Framework . Assert . AreEqual ( absolutePathRoot + "test/folder/index.html" , resolver . GetBaseUri ( ) ) ;
0 commit comments