Skip to content
This repository
tree: e1b9adf525
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 20 lines (17 sloc) 0.684 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
use CgOp;
use Test;
use JSYNC;

sub cgopt($term, $name, $want) {
    is to-json($term), $want, $name;
}

cgopt CgOp._cgop("foo",1,2), '_cgop("foo",1,2)', '["foo",1,2]';
cgopt CgOp.letvar("bar"), 'letvar("bar")', '["letvar","bar"]';
cgopt CgOp.string_var("bar"), 'string_var',
    '["box","Str",["str","bar"]]';
cgopt CgOp.let(CgOp.letvar('x'), -> $k { $k }), 'let',
    '["letn","!L0",["letvar","x"],["letvar","!L0"]]';
cgopt CgOp.subcall(CgOp.letvar('x'), CgOp.letvar('y')), 'sub1',
    '["subcall","\\u0000",["letvar","x"],["letvar","y"]]';
cgopt CgOp.subcall(CgOp.letvar('x'), ':foo', CgOp.letvar('y')), 'sub1',
    '["subcall","\\u0004:foo",["letvar","x"],["letvar","y"]]';
done;
Something went wrong with that request. Please try again.