mirror of
				https://github.com/JakeWharton/mosaic.git
				synced 2025-10-31 18:58:37 +08:00 
			
		
		
		
	Two quick helpers for testing statics (#634)
Not great, but better than we have.
This commit is contained in:
		| @ -14,12 +14,16 @@ import kotlinx.coroutines.currentCoroutineContext | ||||
| import kotlinx.coroutines.delay | ||||
| import kotlinx.coroutines.withTimeout | ||||
|  | ||||
| public suspend fun runMosaicTest(block: suspend TestMosaic<String>.() -> Unit) { | ||||
| 	runMosaicTest(PlainTextSnapshots, block) | ||||
| } | ||||
|  | ||||
| public fun interface SnapshotStrategy<T> { | ||||
| 	public fun create(mosaic: Mosaic): T | ||||
| } | ||||
|  | ||||
| public suspend fun runMosaicTest(block: suspend TestMosaic<String>.() -> Unit) { | ||||
| 	runMosaicTest(PlainTextSnapshots, block) | ||||
| public object MosaicSnapshots : SnapshotStrategy<Mosaic> { | ||||
| 	override fun create(mosaic: Mosaic): Mosaic = mosaic | ||||
| } | ||||
|  | ||||
| public suspend fun <T, R> runMosaicTest( | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Jake Wharton
					Jake Wharton