Add additional tests for extract_urls
This commit is contained in:
		
							parent
							
								
									db350883cc
								
							
						
					
					
						commit
						d40b42c77d
					
				
							
								
								
									
										26
									
								
								test/menu.c
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								test/menu.c
									
									
									
									
									
								
							| @ -39,6 +39,29 @@ TEST test_extract_urls_from_two_url_string(void) | ||||
|         PASS(); | ||||
| } | ||||
| 
 | ||||
| TEST test_extract_urls_from_one_url_port(void) | ||||
| { | ||||
|         char *urls = extract_urls("Hi from https://www.example.com:8100 and have a nice day!"); | ||||
|         ASSERT_STR_EQ("https://www.example.com:8100", urls); | ||||
|         g_free(urls); | ||||
|         PASS(); | ||||
| } | ||||
| 
 | ||||
| TEST test_extract_urls_from_one_url_path(void) | ||||
| { | ||||
|         char *urls = extract_urls("Hi from https://www.example.com:8100/testpath and have a nice day!"); | ||||
|         ASSERT_STR_EQ("https://www.example.com:8100/testpath", urls); | ||||
|         g_free(urls); | ||||
|         PASS(); | ||||
| } | ||||
| 
 | ||||
| TEST test_extract_urls_from_one_url_anchor(void) | ||||
| { | ||||
|         char *urls = extract_urls("Hi from https://www.example.com:8100/testpath#anchor and have a nice day!"); | ||||
|         ASSERT_STR_EQ("https://www.example.com:8100/testpath#anchor", urls); | ||||
|         g_free(urls); | ||||
|         PASS(); | ||||
| } | ||||
| 
 | ||||
| SUITE(suite_menu) | ||||
| { | ||||
| @ -46,5 +69,8 @@ SUITE(suite_menu) | ||||
|         RUN_TEST(test_extract_urls_from_no_urls_string); | ||||
|         RUN_TEST(test_extract_urls_from_one_url_string); | ||||
|         RUN_TEST(test_extract_urls_from_two_url_string); | ||||
|         RUN_TEST(test_extract_urls_from_one_url_port); | ||||
|         RUN_TEST(test_extract_urls_from_one_url_path); | ||||
|         RUN_TEST(test_extract_urls_from_one_url_anchor); | ||||
| } | ||||
| /* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */ | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Benedikt Heine
						Benedikt Heine