Ignore:
Timestamp:
Jan 31, 2009, 10:30:37 PM (12 years ago)
Author:
Peter Johansson
Message:

Merged patch release 0.6.7 to trunk. Delta 0.6.7 - 0.6.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/trac_test.cc

    r693 r768  
    22
    33/*
    4   Copyright (C) 2007 Peter Johansson
     4  Copyright (C) 2007, 2008, 2009 Peter Johansson
    55
    66  This file is part of svndigest, http://dev.thep.lu.se/svndigest
     
    3131
    3232bool test(std::string mess, std::string href, std::ostream&);
     33bool test_no_anchor(std::string str, std::ostream&);
    3334
    3435int main(const int argc,const char* argv[])
     
    7879  ok &= test("#65", conf.trac_root()+"ticket/65", my_out);
    7980  ok &= test("ticket:65", conf.trac_root()+"ticket/65", my_out);
     81  ok &= test_no_anchor("Container2D", my_out);
     82  ok &= test_no_anchor("r2b", my_out);
     83  ok &= test_no_anchor("ar2", my_out);
     84  ok &= test_no_anchor("2r2", my_out);
     85  ok &= test_no_anchor("r2r3", my_out);
     86  ok &= test_no_anchor("ar2:3", my_out);
     87  ok &= test_no_anchor("r2:3a", my_out);
    8088
    8189  if (ok)
     
    100108}
    101109
     110bool test_no_anchor(std::string str, std::ostream& os)
     111{
     112  using namespace theplu::svndigest;
     113  std::stringstream ss;
     114  HtmlStream html(ss);
     115  Trac trac(html);
     116  trac.print(str,80);
     117  if (ss.str()!=str) {
     118    os << "error:\n";
     119    os << "  message: " << str << std::endl;
     120    os << "  trac generates output:\n     " << ss.str() << std::endl;
     121    os << "  expected:\n     " << str << std::endl;
     122    return false;
     123  }
     124  return true;
     125}
Note: See TracChangeset for help on using the changeset viewer.