Branch: Tag:

2001-01-30

2001-01-30 04:49:30 by Per Hedbor <ph@opera.com>

More tests

Rev: server/etc/test/tests/pike_test_common.pike:1.2
Rev: server/etc/test/tests/userdbmodules/RoxenTest_userdbs.pike:1.3

5:   {    array res = ({});    foreach( args, mixed arg ) -  { +     if( mappingp(arg) || arrayp(arg) )    res+=({sprintf("%t<%d>",arg,sizeof(arg))}); -  +  else if( objectp( arg ) ) +  if( arg->is_module ) +  res += ({ sprintf("%s",arg->my_configuration()->otomod[arg])}); +  else if( arg->is_configuration ) +  res += ({ "Config" });    else -  +  res += ({ sprintf("%O", arg ) }); +  else    res+=({sprintf("%O",arg)}); -  } +     return res * ", ";   }   
106:    else    report_test_ok( err, cb, args, st );   } +  +  + function check_is( mixed m ) + { +  return +  lambda( mixed res, mixed err, function cb, array args, int st ) +  { +  if( err ) +  report_test_failure( err, cb, args, st ); +  else +  if( res != m ) +  report_test_failure(sprintf("Got %O, expected %O", res,m), +  cb,args,st); +  else +  report_test_ok( err, cb, args, st ); +  }; + } +  + function check_equal( mixed m ) + { +  return +  lambda( mixed res, mixed err, function cb, array args, int st ) +  { +  if( err ) +  report_test_failure( err, cb, args, st ); +  else +  if( !equal( res, m )) +  report_test_failure(sprintf("Got %O, expected %O", res,m), +  cb,args,st); +  else +  report_test_ok( err, cb, args, st ); +  }; + } +  + function check_not_equal( mixed m ) + { +  return +  lambda( mixed res, mixed err, function cb, array args, int st ) +  { +  if( err ) +  report_test_failure( err, cb, args, st ); +  else +  if( equal( res, m )) +  report_test_failure(sprintf("Got %O, expected %O", res,m), +  cb,args,st); +  else +  report_test_ok( err, cb, args, st ); +  }; + }