CAD-Firemen

 view release on metacpan or  search on metacpan

bin/fm_check_struct  view on Meta::CPAN

    testFailed($test);
    if($verbose > 0){
      print "Could not find copied config.pro\n";
    }
    exit 1;
  }
  # move config.pro to create a new adapted one
  if(!move(getInstallationConfigPro($path), $oldCfg)){
    testFailed($test);
    if($verbose > 0){
      print "Could not backup ". $envCfg ."\n";
    }
    exit 1;
  }
  # adapt config
  if(!open($fhOld, "<", $oldCfg)){
    testFailed($test);
    if($verbose > 0){
      print "Could not open ". $oldCfg ." for reading\n";
    }
    exit 1;

t/01-Common.t  view on Meta::CPAN

  is(CAD::Firemen::Common::untaint($string), $string);
  $string = "This is a string with a ; in it, which is totaly ok";
  is(CAD::Firemen::Common::untaint($string), $string);

  # maxLength
  my @test = qw(wirklichamlaengsten laenger kurz nochlaenger);
  is(maxLength(@test), length($test[0]), "wirklichamlaengsten not the longest");

  # we must clear the config file before
  my $origFile = CAD::Firemen::Common::_settingsFile();
  my $backupFile = $origFile .".backup";
  move($origFile, $backupFile);
  # testing getInstallationPath, ...ConfigCDB, ...ConfigPro
  $ENV{PATH} = "C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;D:\\Program Files\\proeWildfire 5.0\\bin;D:\\Program Files\\proeWildfire 5.0\\mech\\bin";
  is(getInstallationPath(), "D:\\Program Files\\proeWildfire 5.0", "Get wrong installation path");
  is(getInstallationConfigCdb(), "D:\\Program Files\\proeWildfire 5.0/text/config.cdb", "Get wrong config.cdb");
  is(getInstallationConfigPro(), "D:\\Program Files\\proeWildfire 5.0/text/config.pro", "Get wrong config.pro");
  # restore config file
  move($backupFile, $origFile);

  # testing print methods

  # printColored
  my ($result, $output) = runRedirectedAll(\&printColored, "Test", "red");
  #is($output, "Test", "Testing print colored");
  is($output, "Test", "Testing print colored");

  # print2ColsRightAligned
  ($result, $output) = runRedirectedAll(\&print2ColsRightAligned, "Super Test", "Result", "green");



( run in 1.064 second using v1.01-cache-2.11-cpan-49f99fa48dc )