roc/test/str/app_direct_utils.roc
Luke Boswell cd6a5900c6
fix multi-module platform exposes and add str platform tests
Fix a bug where platforms exposing multiple modules would fail at runtime
with "nested value not found" errors when modules call each other's methods.

Root cause: compileAndSerializeModulesForEmbedding was passing module names
in the wrong order (exposed_modules.items vs sorted_modules), and wasn't
passing type module names when compiling sibling platform modules.

Changes:
- src/cli/main.zig: Pass sorted_modules as type module names when compiling
  platform modules, platform main, and app modules
- src/eval/interpreter.zig: Improve error messages for nested_value_not_found
- src/canonicalize/Can.zig: Add trace output for nested_value_not_found

Test infrastructure:
- Add SimpleTestSpec and simple_list variant to platform_config.zig
- Add 8 str platform tests covering direct calls, transitive calls, and
  diamond dependency patterns
- Update test_runner.zig to handle simple_list
- Add test_runner invocations for int and str platforms to build.zig
- Make CLI tests run sequentially to avoid cache race conditions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 17:10:56 +11:00

9 lines
303 B
Text

# TEST: Direct call to Utils (no imports in Utils)
app [process_string] { pf: platform "./platform/main.roc" }
import pf.Utils
process_string : Str -> Str
process_string = |input|
# Include expected substring for test validation
"Got the following from the host: ${input} ${Utils.tag(input)}"