/****************************************************************************** __ ____ __ / / ___ ____ _/ __/_____________ _/ /__ / / / _ \/ __ `/ /_/ ___/ ___/ __ `/ / _ \ / /___/ __/ /_/ / __(__ ) /__/ /_/ / / __/ /_____/\___/\__,_/_/ /____/\___/\__,_/_/\___/ (C)opyright 2026, Leafscale, LLC - https://www.leafscale.com Project: repoman Filename: tests/test_config_schema_v3.reef Authors: Chris Tusa License: Description: Tests: schema 3 ([host].lan_ip) parse/serialize ******************************************************************************/ import config import test.framework import core.result_generic as rg import core.str proc main() let runner = new framework.TestRunner() // Build a schema-3 registry, serialize, parse round-trip let reg = config.Registry { schema: 3, host: config.Host { lan_ip: "192.168.168.124" }, output: "quiet", defaults: config.Defaults { repos_root: "~/repos", backup_root: "/nfs/repos", logdir: "~/.local/state/repoman", incus_project: "repoman", default_image: "images:ubuntu/26.04/cloud", profiles: ["default"] }, projects: new [config.Project](0) } let s = config.serialize_registry(reg) runner.assert_contains_string(s, "schema = 3", "writes schema = 3") runner.assert_contains_string(s, "[host]", "writes [host] block") runner.assert_contains_string(s, "lan_ip = \"192.168.168.124\"", "writes lan_ip") let neg = str.contains(s, "[defaults.llm]") runner.assert_eq_bool(neg, false, "does NOT write [defaults.llm]") let r2 = config.parse_registry(s) runner.assert_eq_bool(rg.is_ok(r2), true, "round-trip parses ok") if rg.is_ok(r2) let reg2 = rg.unwrap_ok(r2) runner.assert_eq_int(reg2.schema, 3, "round-trip schema = 3") runner.assert_eq_string(reg2.host.lan_ip, "192.168.168.124", "round-trip host.lan_ip") end if runner.report() end main