pike.git / lib / modules / testsuite.in

version» Context lines:

pike.git/lib/modules/testsuite.in:111:      dnl - TODO: Future()->get().      dnl - map()   init_promise()   test_do([[ add_constant("future", future->map(`+, 100)); ]])   init_future()   test_do([[ promise->success(17); ]])   exit_promise(1, 117)    - dnl - flat_map() + dnl - map_with() + init_promise() + test_do([[ add_constant("p11", Concurrent.Promise()); ]]) + test_do([[ add_constant("future", future->map_with( +  lambda(int resp) { +  p11->success(resp + 11); +  return p11->future(); +  })); ]]) + test_do([[ add_constant("future", future->recover_with( +  lambda(int resp) { +  p11->success(resp + 12); +  return p11->future(); +  })); ]]) + init_future() + test_do([[ promise->success(10); ]]) + test_do([[ add_constant("p11"); ]]) + exit_promise(1, 21)      dnl - recover()   init_promise()   test_do([[ add_constant("future", future->recover(`+, 12)); ]])   init_future()   test_do([[ promise->failure(10); ]])   exit_promise(1, 22)      dnl - recover_with() -  + init_promise() + test_do([[ add_constant("p11", Concurrent.Promise()); ]]) + test_do([[ add_constant("future", future->map_with( +  lambda(int resp) { +  p11->success(resp + 11); +  return p11->future(); +  })); ]]) + test_do([[ add_constant("future", future->recover_with( +  lambda(int resp) { +  p11->success(resp + 12); +  return p11->future(); +  })); ]]) + init_future() + test_do([[ promise->failure(10); ]]) + test_do([[ add_constant("p11"); ]]) + exit_promise(1, 22)      dnl - filter() - true   init_promise()   test_do([[ add_constant("future", future->filter(`&, 1)); ]])   init_future()   test_do([[ promise->success(11); ]])   exit_promise(1, 11)      dnl - filter() - false   init_promise()
pike.git/lib/modules/testsuite.in:160:   dnl - transform() - exception   init_promise()   test_do([[ add_constant("future", future->transform(`+, throw)); ]])   init_future()   test_do([[ promise->failure(1); ]])   exit_promise(-1, 1)      dnl - transform_with()      dnl - zip() + init_promise() + test_do([[ add_constant("p11", Concurrent.Promise()); ]]) + test_do([[ add_constant("p12", Concurrent.Promise()); ]]) + test_do([[ add_constant("p13", Concurrent.Promise()); ]]) + test_do([[ p12->success(12); ]]) + test_do([[ promise->success(14); ]]) + test_do([[ add_constant("future", +  promise->future()->zip(p11, p12, p13)); ]]) + init_future() + test_do([[ p13->success(13); ]]) + test_do([[ p11->success(11); ]]) + test_do([[ add_constant("p11"); ]]) + test_do([[ add_constant("p12"); ]]) + test_do([[ add_constant("p13"); ]]) + exit_promise(1, ({14, 11, 12, 13}))      dnl - Promise.depend() - true   init_promise()   test_do([[ add_constant("p11", Concurrent.Promise()); ]])   test_do([[ add_constant("p12", Concurrent.Promise()); ]])   test_do([[ add_constant("p13", Concurrent.Promise()); ]])   test_do([[ add_constant("future",    promise->depend(({p11->future(),p12->future()}))    ->depend(({}))->depend(p13->future())    ->depend(({p13->future(),p11->future(),p12->future()}))); ]])   test_do([[ promise->depend()->success(14); ]])   test_do([[ p13->success(13); ]]) -  + test_do([[ promise->depend()->success(15); ]])   init_future()   test_do([[ p11->success(11); ]])   test_do([[ p12->success(12); ]])   test_do([[ add_constant("p11"); ]])   test_do([[ add_constant("p12"); ]])   test_do([[ add_constant("p13"); ]]) -  + exit_promise(1, ({11, 12, 13, 13, 11, 12, 14, 15})) +  + dnl - Promise.depend() no backend - true + init_promise() + test_do([[ Concurrent.use_backend(0); ]]); + test_do([[ add_constant("p11", Concurrent.Promise()); ]]) + test_do([[ add_constant("p12", Concurrent.Promise()); ]]) + test_do([[ add_constant("p13", Concurrent.Promise()); ]]) + test_do([[ add_constant("future", +  promise->depend(({p11->future(),p12->future()})) +  ->depend(({}))->depend(p13->future()) +  ->depend(({p13->future(),p11->future(),p12->future()}))); ]]) + test_do([[ promise->depend()->success(14); ]]) + test_do([[ p13->success(13); ]])   test_do([[ promise->depend()->success(15); ]]) -  + init_future() + test_do([[ p11->success(11); ]]) + test_do([[ p12->success(12); ]]) + test_do([[ add_constant("p11"); ]]) + test_do([[ add_constant("p12"); ]]) + test_do([[ add_constant("p13"); ]])   exit_promise(1, ({11, 12, 13, 13, 11, 12, 14, 15})) -  + test_do([[ Concurrent.use_backend(1); ]]);      dnl - Promise.depend() - false   init_promise()   test_do([[ add_constant("p11", Concurrent.Promise()); ]])   test_do([[ add_constant("p12", Concurrent.Promise()); ]])   test_do([[ add_constant("p13", Concurrent.Promise()); ]])   test_do([[ add_constant("future",    promise->depend(({p11->future(),p12->future()}))    ->depend(({}))->depend(p13->future())    ->depend(({p13->future(),p11->future(),p12->future()}))); ]])   test_do([[ promise->depend()->success(14); ]])   test_do([[ p11->success(11); ]]) -  + test_do([[ promise->depend()->success(15); ]])   init_future()   test_do([[ p13->failure(13); ]])   test_do([[ p12->failure(12); ]])   test_do([[ add_constant("p11"); ]])   test_do([[ add_constant("p12"); ]])   test_do([[ add_constant("p13"); ]]) -  + exit_promise(-1, 13) +  + dnl - Promise.depend() no backend - false + init_promise() + test_do([[ Concurrent.use_backend(0); ]]); + test_do([[ add_constant("p11", Concurrent.Promise()); ]]) + test_do([[ add_constant("p12", Concurrent.Promise()); ]]) + test_do([[ add_constant("p13", Concurrent.Promise()); ]]) + test_do([[ add_constant("future", +  promise->depend(({p11->future(),p12->future()})) +  ->depend(({}))->depend(p13->future()) +  ->depend(({p13->future(),p11->future(),p12->future()}))); ]]) + test_do([[ promise->depend()->success(14); ]]) + test_do([[ p11->success(11); ]])   test_do([[ promise->depend()->success(15); ]]) -  + init_future() + test_do([[ p13->failure(13); ]]) + test_do([[ p12->failure(12); ]]) + test_do([[ add_constant("p11"); ]]) + test_do([[ add_constant("p12"); ]]) + test_do([[ add_constant("p13"); ]])   exit_promise(-1, 13) -  + test_do([[ Concurrent.use_backend(1); ]]);      dnl - Promise.fold() - true   init_promise()   test_do([[ add_constant("p11", Concurrent.Promise()); ]])   test_do([[ add_constant("p12", Concurrent.Promise()); ]])   test_do([[ add_constant("p13", Concurrent.Promise()); ]])   test_do([[ add_constant("future", -  promise->fold(({p11->future(),p12->future()})) -  ->fold(({}))->fold(p13->future()) -  ->fold(({p13->future(),p11->future(),p12->future()}))); ]]) - test_do([[ promise->fold()->success(14); ]]) +  promise->depend(({p11->future(),p12->future()})) +  ->depend(({}))->depend(p13->future()) +  ->depend(({p13->future(),p11->future(),p12->future()}))); ]]) + test_do([[ promise->depend()->success(14); ]])   test_do([[ p13->success(13); ]]) -  + test_do([[ promise->depend()->success(15); ]]) + test_do([[ promise->fold(10, +  lambda(int val, int acc) { return val+acc; }); ]])   init_future()   test_do([[ p11->success(11); ]])   test_do([[ p12->success(12); ]])   test_do([[ add_constant("p11"); ]])   test_do([[ add_constant("p12"); ]])   test_do([[ add_constant("p13"); ]]) - test_do([[ promise->fold()->success(15); ]]) - test_do([[ promise->apply_fold(10, -  lambda(int val, int acc) { return val+acc; }); ]]) +    exit_promise(1, 10 + 11 + 12 + 13 + 13 + 11 + 12 + 14 + 15)      dnl - Promise.fold() - false   init_promise()   test_do([[ add_constant("p11", Concurrent.Promise()); ]])   test_do([[ add_constant("p12", Concurrent.Promise()); ]])   test_do([[ add_constant("p13", Concurrent.Promise()); ]])   test_do([[ add_constant("future", -  promise->fold(({p11->future(),p12->future()})) -  ->fold(({}))->fold(p13->future()) -  ->fold(({p13->future(),p11->future(),p12->future()}))); ]]) - test_do([[ promise->fold()->success(14); ]]) +  promise->depend(({p11->future(),p12->future()})) +  ->depend(({}))->depend(p13->future()) +  ->depend(({p13->future(),p11->future(),p12->future()}))); ]]) + test_do([[ promise->depend()->success(14); ]])   test_do([[ p13->success(13); ]]) -  + test_do([[ promise->depend()->success(15); ]]) + test_do([[ promise->fold(10, +  lambda(int val, int acc) { return val+acc; }); ]])   init_future()   test_do([[ p11->failure(11); ]])   test_do([[ p12->failure(12); ]])   test_do([[ add_constant("p11"); ]])   test_do([[ add_constant("p12"); ]])   test_do([[ add_constant("p13"); ]]) - test_do([[ promise->fold()->success(15); ]]) - test_do([[ promise->apply_fold(10, -  lambda(int val, int acc) { return val+acc; }); ]]) +    exit_promise(-1, 11)      dnl - Concurrent.first_completed() -  + init_promise() + test_do([[ add_constant("p11", Concurrent.Promise()); ]]) + test_do([[ add_constant("p12", Concurrent.Promise()); ]]) + test_do([[ add_constant("p13", Concurrent.Promise()); ]]) + test_do([[ add_constant("future", +  Concurrent.first_completed(({p11, promise, p12, p13}) +  ->future())); ]]) + init_future() + test_do([[ p12->success(12); ]]) + test_do([[ p13->success(13); ]]) + test_do([[ promise->success(14); ]]) + test_do([[ p11->success(11); ]]) + test_do([[ add_constant("p11"); ]]) + test_do([[ add_constant("p12"); ]]) + test_do([[ add_constant("p13"); ]]) + exit_promise(1, 12)      dnl - Concurrent.results() -  + init_promise() + test_do([[ add_constant("p11", Concurrent.Promise()); ]]) + test_do([[ add_constant("p12", Concurrent.Promise()); ]]) + test_do([[ add_constant("p13", Concurrent.Promise()); ]]) + test_do([[ add_constant("future", +  Concurrent.results(({p11, promise, p12, p13}) +  ->future())); ]]) + init_future() + test_do([[ p12->success(12); ]]) + test_do([[ p13->success(13); ]]) + test_do([[ promise->success(14); ]]) + test_do([[ p11->success(11); ]]) + test_do([[ add_constant("p11"); ]]) + test_do([[ add_constant("p12"); ]]) + test_do([[ add_constant("p13"); ]]) + exit_promise(1, ({11, 14, 12, 13}))      dnl - Concurrent.traverse() -  + init_promise() + test_do([[ add_constant("p11", Concurrent.Promise()); ]]) + test_do([[ add_constant("p12", Concurrent.Promise()); ]]) + test_do([[ add_constant("p13", Concurrent.Promise()); ]]) + test_do([[ add_constant("future", +  Concurrent.traverse(({p11, promise, p12, p13}) +  ->future(), lambda(int val) { return val+val;})); ]]) + init_future() + test_do([[ p12->success(12); ]]) + test_do([[ p13->success(13); ]]) + test_do([[ promise->success(14); ]]) + test_do([[ p11->success(11); ]]) + test_do([[ add_constant("p11"); ]]) + test_do([[ add_constant("p12"); ]]) + test_do([[ add_constant("p13"); ]]) + exit_promise(1, ({11+11, 14+14, 12+12, 13+13}))      dnl - Concurrent.fold() -  + init_promise() + test_do([[ add_constant("p11", Concurrent.Promise()); ]]) + test_do([[ add_constant("p12", Concurrent.Promise()); ]]) + test_do([[ add_constant("p13", Concurrent.Promise()); ]]) + test_do([[ add_constant("future", +  Concurrent.fold(({p11, promise, p12, p13}) +  ->future(), 10, lambda(int val, int acc) { return val+acc;})); ]]) + init_future() + test_do([[ p12->success(12); ]]) + test_do([[ p13->success(13); ]]) + test_do([[ promise->success(14); ]]) + test_do([[ p11->success(11); ]]) + test_do([[ add_constant("p11"); ]]) + test_do([[ add_constant("p12"); ]]) + test_do([[ add_constant("p13"); ]]) + exit_promise(1, 10+11+14+12+13)      test_do([[ add_constant("future"); ]])   test_do([[ add_constant("promise"); ]])   test_do([[ add_constant("AsyncResult"); ]])      dnl - NetUtils      test_equal( NetUtils.string_to_ip( "0.0.0.0" ), 0 );   test_equal( NetUtils.string_to_ip( "255.0.0.0" ), 0xff000000 );   test_equal( NetUtils.string_to_ip( "0.255.0.0" ), 0x00ff0000 );
pike.git/lib/modules/testsuite.in:749:   test_equal( o("x"/" ")->i, 42 )   test_equal( o("x -i 7"/" ")->i, 7 )   test_equal( o("/a/b/c -v"/" ")[Arg.PATH], "/a/b/c" )   test_equal( o("/a/b/c -v"/" ")[Arg.APP], "c")   test_equal( o("x"/" ")->m, 0)   test_equal( o("x -m a"/" ")->m, ({ "a" }))   test_equal( o("x -m a -m b"/" ")->m, ({ "a", "b" }))      test_do(add_constant("o"))    -  +    dnl - Array      test_equal(Array.diff(({ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }),    ({ 6, 7, 8, 9, 3, 4, 5, 1, 2, 0 })),    ({ ({ ({ 0, 1, 2, 3, 4, 5 }),    ({ 6, 7, 8, 9 }), ({}) }),    ({ ({}), ({ 6, 7, 8, 9 }),    ({ 3, 4, 5, 1, 2, 0 }) }) }))   test_equal(Array.diff(({ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }),    ({ 9, 7, 8, 4, 5, 6, 0, 1, 2, 3 })),
pike.git/lib/modules/testsuite.in:1902:    a[i] = TestResourceCount->acquire();    }    for(i = 0; i < 10; i++) {    a[i] = 0;    a[i] = TestResourceCount->drained();    }    return a;   ]], ({ 0,0,0,0,0,0,0,0,0,1 }))   test_do([[ add_constant("TestResourceCount"); ]])    - test_false(!Val.true) - test_true(!Val.false) - test_eq((int) Val.true, 1) - test_eq((int) Val.false, 0) - test_eq((string) Val.true, "1") - test_eq((string) Val.false, "0") - test_false(Val.true == 0) - test_false(Val.true == 1) - test_false(Val.false == 0) - test_false(Val.false == 1) - test_false(Val.true == Val.false) - test_true(Val.true == Val.true) - test_true(Val.false == Val.false) -  - test_true(!Val.null) - test_eval_error((int) Val.null) - test_eval_error((string) Val.null) - test_false(Val.null == 0) - test_false(Val.null == 1) - test_false(Val.null == Val.true) - test_false(Val.null == Val.false) - test_true(Val.null == Val.null) -  - test_true(decode_value (encode_value (Val.null)) == Val.null) - test_true(decode_value (encode_value (Val.true)) == Val.true) - test_true(decode_value (encode_value (Val.false)) == Val.false) - test_true(decode_value ("\266ke0#\6\5rVal.null") == Val.null) - test_true(decode_value ("\266ke0#\6\5rVal.true") == Val.true) - test_true(decode_value ("\266ke0#\6\6rVal.false") == Val.false) -  - test_true(([Val.null: 1])[Val.null]) - test_false(([Val.false: 1])[Val.null]) - test_false(([0: 1])[Val.null]) - test_true(([Val.true: 1])[Val.true]) - test_false(([Val.true: 1])[Val.false]) - test_true(([Val.false: 1])[Val.false]) - test_false(([Val.true: 1])[Val.false]) -  +    test_any([[    function a = lambda(string x) { return x+"a"; };    function b = lambda(string x) { return x+"b"; };    function q = Function.composite(a, b);    return map("123"/1, q)*"-";   ]], "1ba-2ba-3ba")      END_MARKER