mirror of
				https://github.com/datahub-project/datahub.git
				synced 2025-10-31 02:37:05 +00:00 
			
		
		
		
	 35d134b981
			
		
	
	
		35d134b981
		
			
		
	
	
	
	
		
			
			Co-authored-by: si-chakraborty <si.chakraborty@adevinta.com> Co-authored-by: david-leifker <114954101+david-leifker@users.noreply.github.com>
		
			
				
	
	
		
			19 lines
		
	
	
		
			575 B
		
	
	
	
		
			Java
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			575 B
		
	
	
	
		
			Java
		
	
	
	
	
	
| package utils;
 | |
| 
 | |
| import static org.junit.jupiter.api.Assertions.assertEquals;
 | |
| 
 | |
| import org.junit.jupiter.api.Test;
 | |
| 
 | |
| public class SearchUtilTest {
 | |
|   @Test
 | |
|   public void testEscapeForwardSlash() {
 | |
|     // escape "/"
 | |
|     assertEquals("\\/foo\\/bar", SearchUtil.escapeForwardSlash("/foo/bar"));
 | |
|     // "/" is escaped but "*" is not escaped and is treated as regex. Since currently we want to
 | |
|     // retain the regex behaviour with "*"
 | |
|     assertEquals("\\/foo\\/bar\\/*", SearchUtil.escapeForwardSlash("/foo/bar/*"));
 | |
|     assertEquals("", "");
 | |
|     assertEquals("foo", "foo");
 | |
|   }
 | |
| }
 |