Files @ 53d3950d9b6b
Branch filter:

Location: CSY/reowolf/src/runtime2/tests/mod.rs

53d3950d9b6b 666 B application/rls-services+xml Show Annotation Show as Raw Download as Raw
MH
WIP: Initial non-communicating component test
use crate::protocol::*;
use crate::protocol::eval::*;
use crate::runtime2::runtime::*;
use crate::runtime2::component::CompPDL;

#[test]
fn test_component_creation() {
    let pd = ProtocolDescription::parse(b"
    primitive nothing_at_all() {
        s32 a = 5;
        print(\"hello\");
        auto b = 5 + a;
    }
    ").expect("compilation");
    let rt = Runtime::new(1, pd);

    let prompt = rt.inner.protocol.new_component(b"", b"nothing_at_all", ValueGroup::new_stack(Vec::new()))
        .expect("component creation");
    let comp = CompPDL::new(prompt, 0);
    let (key, _) = rt.inner.create_pdl_component(comp, true);
    rt.inner.enqueue_work(key);
}