// test-uga.el - Ugaritic morphology tests
// Tests morph_conjugate dispatch for "uga", copula "kn" (via "be"),
// verb "hlk" (go), and morph_pluralize fallback.

fn test_uga() {
    let profile: [String] = lang_profile_uga()

    // Copula "be" present 3sg -> "yakūnu" (imperfect, ya- prefix)
    let r1: String = morph_conjugate("be", "present", "third", "singular", profile)
    if !str_eq(r1, "yakūnu") {
        println("FAIL: uga copula present 3sg: expected 'yakūnu' got '" + r1 + "'")
    } else {
        println("PASS: uga copula present 3sg")
    }

    // Copula "be" perfect 3sg -> "kāna"
    let r2: String = morph_conjugate("be", "perfect", "third", "singular", profile)
    if !str_eq(r2, "kāna") {
        println("FAIL: uga copula perfect 3sg: expected 'kāna' got '" + r2 + "'")
    } else {
        println("PASS: uga copula perfect 3sg")
    }

    // "hlk" (to go) present 3sg -> "yahluku" (imperfect)
    let r3: String = morph_conjugate("hlk", "present", "third", "singular", profile)
    if !str_eq(r3, "yahluku") {
        println("FAIL: uga hlk present 3sg: expected 'yahluku' got '" + r3 + "'")
    } else {
        println("PASS: uga hlk present 3sg")
    }

    // "hlk" perfect 3sg -> "halaka"
    let r4: String = morph_conjugate("hlk", "perfect", "third", "singular", profile)
    if !str_eq(r4, "halaka") {
        println("FAIL: uga hlk perfect 3sg: expected 'halaka' got '" + r4 + "'")
    } else {
        println("PASS: uga hlk perfect 3sg")
    }

    // morph_pluralize: agglutinative fallback returns noun unchanged
    // (uga morph_type is "semitic" — falls through to unknown, returns noun)
    let r5: String = morph_pluralize("malku", profile)
    if !str_eq(r5, "malku") {
        println("FAIL: uga pluralize fallback: expected 'malku' got '" + r5 + "'")
    } else {
        println("PASS: uga pluralize fallback")
    }
}

test_uga()
