package com.tt.honeyDue.resources

import honeydue.composeapp.generated.resources.Res
import honeydue.composeapp.generated.resources.app_icon_mark
import honeydue.composeapp.generated.resources.honeycomb_texture
import honeydue.composeapp.generated.resources.outline
import honeydue.composeapp.generated.resources.tab_view
import honeydue.composeapp.generated.resources.widget_icon
import org.jetbrains.compose.resources.ExperimentalResourceApi
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotNull

/**
 * P1 Stream B — Asset port inventory.
 *
 * Guards iOS → Android brand-asset parity. Each referenced drawable must
 * exist in composeResources so the generated `Res.drawable.<name>` accessor
 * compiles. Any removal will fail at compile time, not silently at runtime.
 *
 * Sources documented in docs/ios-parity/source-assets/ (commit-tracked).
 */
@OptIn(ExperimentalResourceApi::class)
class AssetInventoryTest {

    @Test
    fun all_ported_assets_exist() {
        // Fails to compile if any of these generated symbols don't exist.
        val assets = listOf(
            Res.drawable.outline,
            Res.drawable.tab_view,
            Res.drawable.app_icon_mark,
            Res.drawable.honeycomb_texture,
            Res.drawable.widget_icon
        )

        assertEquals(5, assets.size, "Expected 5 ported brand assets")
        assets.forEach { assertNotNull(it) }
    }

    @Test
    fun assets_are_distinct_resources() {
        // Ensures no accidental alias/duplicate definitions.
        val assets = setOf(
            Res.drawable.outline,
            Res.drawable.tab_view,
            Res.drawable.app_icon_mark,
            Res.drawable.honeycomb_texture,
            Res.drawable.widget_icon
        )
        assertEquals(5, assets.size, "All ported assets must be distinct DrawableResource instances")
    }
}
