LeOS-Genesis/external/badvpn/ncd/tests/backtracking.ncd

32 lines
619 B
Plaintext

process main {
value({}) list;
var("0") i;
backtrack_point() point;
num_lesser(i, "100") do_more;
If (do_more) {
list->insert(i);
num_add(i, "1") new_i;
i->set(new_i);
point->go();
};
val_equal(list.length, "100") a;
assert(a);
value({}) list;
var("0") i;
blocker() blk;
blk->up();
blk->use();
num_lesser(i, "100") do_more;
If (do_more) {
list->insert(i);
num_add(i, "1") new_i;
i->set(new_i);
blk->downup();
};
val_equal(list.length, "100") a;
assert(a);
exit("0");
}