// Example main.js that uses the module system

log.console("=== Module System Test ===")

// Test bare imports
try {
  var sprite = use("sprite")
  log.console("✓ Loaded sprite from bare import")
} catch (e) {
  log.console("✗ Failed to load sprite: " + e)
}

// Test relative imports
try {
  var helper = use("./helper")
  log.console("✓ Loaded helper from relative import")
  helper.greet("Module System")
} catch (e) {
  log.console("✗ Failed to load helper: " + e)
}

// Test scheme-qualified imports
try {
  var core_time = use("core://time")
  log.console("✓ Loaded time from core:// scheme")
} catch (e) {
  log.console("✗ Failed to load core://time: " + e)
}

// Test aliased module (if configured in shop.toml)
try {
  var mod = use("mod/utils")
  log.console("✓ Loaded mod/utils from aliased module")
} catch (e) {
  log.console("✗ Failed to load mod/utils: " + e)
}

log.console("")
log.console("Test complete!")

$_.stop()