pike.git / src / testsuite.in

version» Context lines:

pike.git/src/testsuite.in:1: - test_true([["$Id: testsuite.in,v 1.685 2003/10/10 01:20:14 mast Exp $"]]); + test_true([["$Id: testsuite.in,v 1.686 2003/10/10 15:45:23 grubba Exp $"]]);      // This triggered a bug only if run sufficiently early.   test_compile_any([[#pike 7.2]])   test_compile_any([[#pike 7.4]])   test_compile_any([[#pike 7.0]])   test_compile_any([[#pike 0.6]])      cond([[all_constants()->_verify_internals]],   [[    test_do(_verify_internals())
pike.git/src/testsuite.in:20:   test_eq("\d32","\x20");   test_eq('Å',"Å"[0]);   test_eq('\7777',"\7777"[0]);   test_eq('\77777777',"\77777777"[0]);   test_eq("\x10000","\x10000");   test_eq(0x80000000-0x80000000, 0);   test_eq(0xf0000000-0xf0000000, 0);   test_eq(0x80000001-0x80000000, 1);   test_eq(0x80000000-0x80000001,-1);   test_eq(-2147483648*-1, -2147483648/-1); + test_eq(0x8000000000000000-0x8000000000000000, 0); + test_eq(0xf000000000000000-0xf000000000000000, 0); + test_eq(0x8000000000000001-0x8000000000000000, 1); + test_eq(0x8000000000000000-0x8000000000000001,-1); + test_eq(-9223372036854775808*-1, -9223372036854775808/-1);   test_true([[1.0e-40]]);   test_eq([[#"foo   bar"]],[["foo\nbar"]]);   test_eq([[#"foo\   bar"]],[["foobar"]]);   test_true([[stringp(#string "Makefile")]]);   test_any([[class Bar { array(int) foo = ({}); };    class Foo { inherit Bar; array(int) foo = ({1}); };    return sizeof(Foo()->foo);]],1);   
pike.git/src/testsuite.in:5484:      cond([[ sizeof( cpp("__AUTO_BIGNUM__")/"__AUTO_BIGNUM__" ) == 1 ]],   [[    // Test the lexer.    test_eq("2147483648", [[ (string)0x80000000 ]])    test_eq("2147483649", [[ (string)0x80000001 ]])    test_eq("-2147483648", [[ (string)-0x80000000 ]])    test_eq("-2147483649", [[ (string)-0x80000001 ]])    test_eq("2147483648", [[ (string)-(-0x80000000) ]])    test_eq("2147483649", [[ (string)-(-0x80000001) ]]) +  test_eq("9223372036854775808", [[ (string)0x8000000000000000 ]]) +  test_eq("9223372036854775809", [[ (string)0x8000000000000001 ]]) +  test_eq("-9223372036854775808", [[ (string)-0x8000000000000000 ]]) +  test_eq("-9223372036854775808", [[ (string)-0x8000000000000001 ]]) +  test_eq("9223372036854775808", [[ (string)-(-0x8000000000000000) ]]) +  test_eq("9223372036854775809", [[ (string)-(-0x8000000000000001) ]])    test_eq("123456789123456789", [[ (string)123456789123456789 ]])    test_eq("-123456789123456789", [[ (string)-123456789123456789 ]])    test_eq("335812727629498640265", [[ (string)0x123456789123456789 ]])    test_eq("-335812727629498640265", [[ (string)-0x123456789123456789 ]])    test_eq("718046312823", [[ (string)012345671234567 ]])    test_eq("-718046312823", [[ (string)-012345671234567 ]])    test_eq("1125899906842624", [[ (string)0b100000000000000000000000000000000000000000000000000 ]])    test_eq("-1125899906842624", [[ (string)-0b100000000000000000000000000000000000000000000000000 ]])    test_eq(500000000 * 10, 5000000000) -  +  test_eq(5000000000000000000 * 10, 50000000000000000000)       // These numbers should be ordinary integers.    test_false([[ objectp(-0x80000000) ]])    test_false([[ objectp(-0x7fffffff) ]])    test_false([[ objectp( 0x7fffffff) ]])       // Test incrementations (FIXME: More cases?).    test_eq("2147483648",    [[ (string)(class { int f(int x) { x++; return x; } })()->f(0x7fffffff) ]])    test_eq("2147483648",    [[ (string)(class { int f(int x) { ++x; return x; } })()->f(0x7fffffff) ]])    test_eq("2147483648",    [[ (string)(class { int x=0x7fffffff;int f() { ++x;return x; } })()->f() ]])    test_eq("2147483648",    [[ (string)(class { int x=0x7fffffff;int f() { x++;return x; } })()->f() ]])    test_eq("2147483648",    [[ (string)(class { int f() { int x=0x7fffffff;++x;return x; } })()->f() ]])    test_eq("2147483648",    [[ (string)(class { int f() { int x=0x7fffffff;x++;return x; } })()->f() ]]) -  +  test_eq("9223372036854775808", +  [[ (string)(class { int f(int x) { x++; return x; } })()->f(0x7fffffffffffffff) ]]) +  test_eq("9223372036854775808", +  [[ (string)(class { int f(int x) { ++x; return x; } })()->f(0x7fffffffffffffff) ]]) +  test_eq("9223372036854775808", +  [[ (string)(class { int x=0x7fffffffffffffff;int f() { ++x;return x; } })()->f() ]]) +  test_eq("9223372036854775808", +  [[ (string)(class { int x=0x7fffffffffffffff;int f() { x++;return x; } })()->f() ]]) +  test_eq("9223372036854775808", +  [[ (string)(class { int f() { int x=0x7fffffffffffffff;++x;return x; } })()->f() ]]) +  test_eq("9223372036854775808", +  [[ (string)(class { int f() { int x=0x7fffffffffffffff;x++;return x; } })()->f() ]])       // Test decrementations (FIXME: More cases?).    test_eq("-2147483649",    [[ (string)(class { int f(int x) { x--; return x; } })()->f(-0x80000000) ]])    test_eq("-2147483649",    [[ (string)(class { int f(int x) { --x; return x; } })()->f(-0x80000000) ]])    test_eq("-2147483649",    [[ (string)(class { int x=-0x80000000;int f() { --x;return x; } })()->f()]])    test_eq("-2147483649",    [[ (string)(class { int x=-0x80000000;int f() { x--;return x; } })()->f()]])    test_eq("-2147483649",    [[ (string)(class { int f() { int x=-0x80000000;--x;return x; } })()->f()]])    test_eq("-2147483649",    [[ (string)(class { int f() { int x=-0x80000000;x--;return x; } })()->f()]]) -  +  test_eq("-9223372036854775809", +  [[ (string)(class { int f(int x) { x--; return x; } })()->f(-0x8000000000000000) ]]) +  test_eq("-9223372036854775809", +  [[ (string)(class { int f(int x) { --x; return x; } })()->f(-0x8000000000000000) ]]) +  test_eq("-9223372036854775809", +  [[ (string)(class { int x=-0x8000000000000000;int f() { --x;return x; } })()->f()]]) +  test_eq("-9223372036854775809", +  [[ (string)(class { int x=-0x8000000000000000;int f() { x--;return x; } })()->f()]]) +  test_eq("-9223372036854775809", +  [[ (string)(class { int f() { int x=-0x8000000000000000;--x;return x; } })()->f()]]) +  test_eq("-9223372036854775809", +  [[ (string)(class { int f() { int x=-0x8000000000000000;x--;return x; } })()->f()]])       test_encode(1<<99);   ]])      cond([[ sizeof( cpp("__AUTO_BIGNUM__")/"__AUTO_BIGNUM__" ) == 1 ]],   [[    // - Left shift.    test_eq("1073741824", [[ (string)(1<<30) ]])    test_eq("2147483648", [[ (string)(1<<31) ]])    test_eq("4294967296", [[ (string)(1<<32) ]])
pike.git/src/testsuite.in:5565:    test_eq(-1>>100000000000000000000, -1)    test_eq(0>>100000000000000000000, 0)    test_eq(100000000000000000000>>100000000000000000000, 0)    test_eq((-100000000000000000000)>>100000000000000000000, -1)       // - abs.    test_eq("2147483648", [[ (string)abs(-0x80000000) ]])    test_eq("2147483648", [[ (string)abs(0x80000000) ]])    test_eq("2147483649", [[ (string)abs(0x80000001) ]])    test_eq("2147483649", [[ (string)abs(-0x80000001) ]]) +  test_eq("9223372036854775808", [[ (string)abs(-0x8000000000000000) ]]) +  test_eq("9223372036854775808", [[ (string)abs(0x8000000000000000) ]]) +  test_eq("9223372036854775809", [[ (string)abs(0x8000000000000001) ]]) +  test_eq("9223372036854775809", [[ (string)abs(-0x8000000000000001) ]])       // - Add.    test_eq("2147483648", [[ (string)(0x7fffffff + 1) ]])    test_eq("2147483649", [[ (string)(0x7fffffff + 2) ]]) -  +  test_eq("-2147483648", [[ (string)((-0x80000001) + 1) ]]) +  test_eq("9223372036854775808", [[ (string)(0x7fffffffffffffff + 1) ]]) +  test_eq("92233720368547758089", [[ (string)(0x7fffffffffffffff + 2) ]]) +  test_eq("-9223372036854775808", [[ (string)((-0x8000000000000001) + 1) ]])    test_eq("2684354560", [[ (string)(0x50000000 + 0x50000000) ]])    test_eq("-2684354560", [[ (string)((-0x50000000) + (-0x50000000)) ]]) -  test_eq("-2147483648", [[ (string)((-0x80000001) + 1) ]]) +     test_false([[ objectp((-0x80000001) + 1) ]])       // - Add-eq.    test_eq([[lambda() { int a=0x100000000; int b = a; a += 1; return b+a; }()]],    [[0x200000001]])       // - Sub.    test_eq("-2147483648", [[ (string)(-0x7fffffff - 1) ]])    test_eq("-2147483649", [[ (string)(-0x80000000 - 1) ]])    test_eq("2147483647", [[ (string)(0x80000000 - 1) ]])