package com.example.aiapp import java.time.ZoneId import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertTrue /** * What the transcript says where a session ran out of quota. * * The pair worth a test is the one that reads the same when it goes wrong: a reset time that * arrived and one that never did. The second must not turn into a plausible-looking time, because a * reader has no way of telling an invented one from a reported one. */ class LimitRowTest { private val utc = ZoneId.of("UTC") @Test fun `a reported reset time is shown as a time`() { // 2026-09-05T12:00:00Z. Asserted as a prefix and the clock reading rather than as the // whole string: the platform's own short-time format is what this asks for, and it // differs by JDK and locale down to which space character separates the meridiem. val summary = limitSummary(1_788_609_600.0, utc) assertTrue(summary.startsWith("Usage limit reached • resets "), summary) assertTrue(summary.contains("12:00"), summary) } @Test fun `a limit with no reset time says only what is known`() { assertEquals("Usage limit reached", limitSummary(null, utc)) } }