Ignore:
Timestamp:
Jan 29, 2009, 1:46:49 PM (13 years ago)
Author:
Peter Johansson
Message:

fixes #353

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.6-stable/test/trac.cc

    r731 r761  
    3333
    3434bool test(std::string mess, std::string href, std::ostream&);
     35bool test_no_anchor(std::string str, std::ostream&);
    3536
    3637int main(const int argc,const char* argv[])
     
    8081  ok &= test("#65", conf.trac_root()+"ticket/65", my_out);
    8182  ok &= test("ticket:65", conf.trac_root()+"ticket/65", my_out);
     83  ok &= test_no_anchor("Container2D", my_out);
     84  ok &= test_no_anchor("r2b", my_out);
     85  ok &= test_no_anchor("ar2", my_out);
     86  ok &= test_no_anchor("2r2", my_out);
     87  ok &= test_no_anchor("r2r3", my_out);
     88  ok &= test_no_anchor("ar2:3", my_out);
     89  ok &= test_no_anchor("r2:3a", my_out);
    8290
    8391  if (ok)
     
    102110}
    103111
     112bool test_no_anchor(std::string str, std::ostream& os)
     113{
     114  using namespace theplu::svndigest;
     115  std::stringstream ss;
     116  HtmlStream html(ss);
     117  Trac trac(html);
     118  trac.print(str,80);
     119  if (ss.str()!=str) {
     120    os << "error:\n";
     121    os << "  message: " << str << std::endl;
     122    os << "  trac generates output:\n     " << ss.str() << std::endl;
     123    os << "  expected:\n     " << str << std::endl;
     124    return false;
     125  }
     126  return true;
     127}
Note: See TracChangeset for help on using the changeset viewer.