import Foundation
import Testing
import ForgejoKit
@testable import Forji

struct ForjiTests {

    @Test func formatRelativeDateReturnsNonEmptyString() {
        let fixedDate = Date(timeIntervalSince1970: 0)
        let result = formatRelativeDate(fixedDate)
        #expect(!result.isEmpty)
    }

    @Test func formatRelativeDateHandlesRecentDate() {
        let fixedDate = Date(timeIntervalSince1970: 1000)
        let result = formatRelativeDate(fixedDate)
        #expect(!result.isEmpty)
    }

    @Test func formatRelativeDateReturnsSameValueOnRepeatedCalls() {
        let date = Date().addingTimeInterval(-3600)
        let first = formatRelativeDate(date)
        let second = formatRelativeDate(date)
        #expect(first == second)
    }
}
