052 interpreter identity result

✗ Failing This test is currently failing.

Failed: backend-exec

Error Details

install

Failure Output

Showing last 10 of 32 lines
error: the following command failed with 3 compilation errors:
/opt/homebrew/Cellar/zig/0.15.2_1/bin/zig build-exe -ODebug --dep koru_parser --dep koru_ast=ast --dep koru_errors=errors --dep ast --dep flow_parser --dep liquid -Mroot=/Users/larsde/src/koru/tests/regression/400_RUNTIME_FEATURES/430_RUNTIME/430_052_interpreter_identity_result/output_emitted.zig -ODebug --dep ast --dep lexer --dep errors --dep type_registry --dep expression_parser --dep union_collector --dep module_resolver -Mkoru_parser=/usr/local/lib/koru/src/parser.zig -ODebug --dep errors -Mast=/usr/local/lib/koru/src/ast.zig -ODebug -Merrors=/usr/local/lib/koru/src/errors.zig -ODebug --dep ast --dep lexer --dep errors --dep expression_parser -Mflow_parser=/usr/local/lib/koru/src/flow_parser.zig -ODebug -Mliquid=/usr/local/lib/koru/src/liquid.zig -ODebug -Mlexer=/usr/local/lib/koru/src/lexer.zig -ODebug --dep ast --dep log -Mtype_registry=/usr/local/lib/koru/src/type_registry.zig -ODebug --dep lexer --dep ast -Mexpression_parser=/usr/local/lib/koru/src/expression_parser.zig -ODebug --dep ast -Munion_collector=/usr/local/lib/koru/src/union_collector.zig -ODebug --dep config --dep log -Mmodule_resolver=/usr/local/lib/koru/src/module_resolver.zig -ODebug -Mlog=/usr/local/lib/koru/src/log.zig -ODebug --dep log -Mconfig=/usr/local/lib/koru/src/config.zig --cache-dir .zig-cache --global-cache-dir /Users/larsde/.cache/zig --name output --zig-lib-dir /opt/homebrew/Cellar/zig/0.15.2_1/lib/zig/ --listen=-

Build Summary: 0/3 steps succeeded; 1 failed
install transitive failure
+- install output transitive failure
   +- compile exe output Debug native 3 errors

error: the following build command failed with exit code 1:
.zig-cache/o/ab7734ce170e335c623eadd760da5c97/build /opt/homebrew/Cellar/zig/0.15.2_1/bin/zig /opt/homebrew/Cellar/zig/0.15.2_1/lib/zig /Users/larsde/src/koru/tests/regression/400_RUNTIME_FEATURES/430_RUNTIME/430_052_interpreter_identity_result .zig-cache /Users/larsde/.cache/zig --seed 0x424d8a29 -Z06a07980f4feabb7

Code

// Test: Interpreter identity branch constructor (result s) and discard (_)

~import "$std/runtime"
~import "$std/interpreter"
~import "$std/io"

const std = @import("std");

// Event with identity branch payload
~pub event add { a: i64, b: i64 }
| sum i64

~add = sum a + b

~std.runtime:register(scope: "test") {
    add
}

const TEST_SOURCE_IDENTITY =
    \\~add(a: 3, b: 4)
    \\| sum s |> result s
;

const TEST_SOURCE_BRANCH =
    \\~add(a: 3, b: 4)
    \\| sum s |> result s.Branch
;

const TEST_SOURCE_DISCARD =
    \\~add(a: 3, b: 4)
    \\| sum s |> _
;

~std.runtime:get_scope(name: "test")
| scope s |> std.interpreter:run(source: TEST_SOURCE_IDENTITY, dispatcher: s.dispatcher)
    | result r |> std.interpreter:value.stringify(value: r.value)
        | json j |> std.io:print.ln("IDENTITY {{ j:s }}")
    | exhausted e |> std.io:print.ln("EXHAUSTED: {{ e.last_event:s }}")
    | parse_error e |> std.io:print.ln("PARSE ERROR: {{ e.message:s }}")
    | validation_error e |> std.io:print.ln("VALIDATION ERROR: {{ e.message:s }}")
    | dispatch_error e |> std.io:print.ln("DISPATCH ERROR: {{ e.message:s }}")
| not_found |> std.io:print.ln("SCOPE NOT FOUND")

~std.runtime:get_scope(name: "test")
| scope s |> std.interpreter:run(source: TEST_SOURCE_BRANCH, dispatcher: s.dispatcher)
    | result r |> std.interpreter:value.stringify(value: r.value)
        | json j |> std.io:print.ln("BRANCH {{ j:s }}")
    | exhausted e |> std.io:print.ln("EXHAUSTED: {{ e.last_event:s }}")
    | parse_error e |> std.io:print.ln("PARSE ERROR: {{ e.message:s }}")
    | validation_error e |> std.io:print.ln("VALIDATION ERROR: {{ e.message:s }}")
    | dispatch_error e |> std.io:print.ln("DISPATCH ERROR: {{ e.message:s }}")
| not_found |> std.io:print.ln("SCOPE NOT FOUND")

~std.runtime:get_scope(name: "test")
| scope s |> std.interpreter:run(source: TEST_SOURCE_DISCARD, dispatcher: s.dispatcher)
    | result r |> std.io:print.ln("DISCARD {{ r.value.branch:s }}")
    | exhausted e |> std.io:print.ln("EXHAUSTED: {{ e.last_event:s }}")
    | parse_error e |> std.io:print.ln("PARSE ERROR: {{ e.message:s }}")
    | validation_error e |> std.io:print.ln("VALIDATION ERROR: {{ e.message:s }}")
    | dispatch_error e |> std.io:print.ln("DISPATCH ERROR: {{ e.message:s }}")
| not_found |> std.io:print.ln("SCOPE NOT FOUND")
input.kz

Expected

IDENTITY {"branch":"result","value":7}
BRANCH {"branch":"result","value":"sum"}
DISCARD discard

Test Configuration

MUST_RUN