ternlang-core 0.3.3

Compiler and VM for Ternlang — balanced ternary language with affirm/tend/reject trit semantics, @sparseskip codegen, and BET bytecode execution.
Documentation
// Module:  stdlib/testing/mock.tern
// Purpose: Test Mocks and Stubs in Ternary
// Author:  RFI-IRFOS
// Ref:     https://ternlang.com

// Creates mock agents that reliably return specific ternary states.

agent MockOptimist {
    fn handle(msg: trit) -> trit {
        return affirm; // Always approves
    }
}

agent MockPessimist {
    fn handle(msg: trit) -> trit {
        return reject; // Always denies
    }
}

agent MockNeutral {
    fn handle(msg: trit) -> trit {
        return tend; // Always holds
    }
}

agent MockEcho {
    fn handle(msg: trit) -> trit {
        return msg; // Returns what it gets
    }
}

fn spawn_mock(mock_type: int) -> trit {
    // Helper to spawn a specific mock type in the test runner
    return affirm;
}