// Minimal test: can we access fields on a plain struct?
use crypto::cardea

struct Simple {
    x: Int,
    y: Float,
    name: String,
}

fn make_simple() -> Simple {
    return Simple { x: 42, y: 3.14, name: "hello" }
}

fn main() {
    let s = make_simple()
    println("Type test:")
    println("  x (Int) = " + int_to_str(s.x))
    println("  y (Float) = " + float_to_str(s.y))
    println("  name (String) = " + s.name)

    println("")
    println("Temporal struct test:")
    let key = livingkey_new()
    println("  generation (Int) = " + int_to_str(key.generation))
    println("  mg_m (Float) = " + float_to_str(key.mg_m))
    println("  mg_h (Float) = " + float_to_str(key.mg_h))

    // Is generation really 0 or is int_to_str(void) just "0"?
    let g = key.generation
    let g_plus = g + 100
    println("  generation + 100 = " + int_to_str(g_plus))

    let m = key.mg_m
    let m_plus = m + 100.0
    println("  mg_m + 100.0 = " + float_to_str(m_plus))
}
