mirror of
				https://github.com/recloudstream/cloudstream.git
				synced 2024-08-15 01:53:11 +00:00 
			
		
		
		
	Test Search Fix
This commit is contained in:
		
							parent
							
								
									2fc279f4ae
								
							
						
					
					
						commit
						a97dbc698c
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		|  | @ -4,6 +4,7 @@ import com.lagradost.cloudstream3.* | ||||||
| import com.lagradost.cloudstream3.mvvm.logError | import com.lagradost.cloudstream3.mvvm.logError | ||||||
| import kotlinx.coroutines.* | import kotlinx.coroutines.* | ||||||
| import org.junit.Assert | import org.junit.Assert | ||||||
|  | import kotlin.random.Random | ||||||
| 
 | 
 | ||||||
| object TestingUtils { | object TestingUtils { | ||||||
|     open class TestResult(val success: Boolean) { |     open class TestResult(val success: Boolean) { | ||||||
|  | @ -280,10 +281,10 @@ object TestingUtils { | ||||||
| 
 | 
 | ||||||
|                     // Test Search Results |                     // Test Search Results | ||||||
|                     val searchQueries = |                     val searchQueries = | ||||||
|                         // Use the first 3 home page results as queries since they are guaranteed to exist |                         // Use the random 3 home page results as queries since they are guaranteed to exist | ||||||
|                         (homePageList.take(3).map { it.name } + |                         (homePageList.shuffled(Random).take(3).map { it.name } + | ||||||
|                                 // If home page is sparse then use generic search queries |                                 // If home page is sparse then use generic search queries | ||||||
|                                 listOf("over", "iron", "guy")).take(3) |                                 listOf("over", "iron", "guy")).take(4) | ||||||
| 
 | 
 | ||||||
|                     val searchResults = testSearch(api, searchQueries, logger) |                     val searchResults = testSearch(api, searchQueries, logger) | ||||||
|                     Assert.assertTrue("Failed to get search results", searchResults.success) |                     Assert.assertTrue("Failed to get search results", searchResults.success) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue