Ignore:
Timestamp:
Aug 7, 2010, 4:31:18 PM (13 years ago)
Author:
Peter Johansson
Message:

allow config file to override svn property (fixes #326). Adding two new files (split.h and split.cc) from yat.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/config_test.cc

    r1119 r1152  
    2929  void test_codon(test::Suite&);
    3030  void test_read_write(test::Suite&);
     31  void test_props(test::Suite&);
    3132}} // end of namespace svndigest and theplu
    3233
     
    3940  test_codon(suite);
    4041  test_read_write(suite);
     42  test_props(suite);
    4143                                                                               
    4244  if (suite.ok()) {
     
    5456  void test_codon(test::Suite& suite)
    5557  {
     58    suite.out() << "test codons" << std::endl;
    5659    const Configuration& c(Configuration::instance());
    5760    if (!c.codon("foo.h")){
     
    6972  }
    7073 
     74  void test_props(test::Suite& suite)
     75  {
     76    suite.out() << "test props" << std::endl;
     77    Configuration& conf(Configuration::instance());
     78    std::stringstream ss;
     79    ss << "[svn_props]\n"
     80       << "foo* = svndigest:ignore\n"
     81       << "bar* = svn:eol-style=native;svncopyright:ignore\n";
     82    conf.load(ss);
     83    const std::map<std::string, std::string>& props =
     84      conf.svn_properties("foo_bla_bla");
     85    if (props.find("svndigest:ignore")==props.end()) {
     86        suite.out() << "property svndigest:ignore not set for foo_bla_bla\n";
     87        suite.add(false);
     88    }
     89    const std::map<std::string, std::string>& props2 =
     90      conf.svn_properties("bar_bla_bla");
     91    std::map<std::string, std::string>::const_iterator it =
     92      props2.find("svn:eol-style");
     93    if (!suite.add(it != props2.end()))
     94      suite.out() <<"expected property 'svn:eol-style' set for bar_bla_bla\n";
     95    else if (!suite.add(it->second == "native"))
     96      suite.out() << "expected 'svn:eol-style' set to 'native' "
     97                  << "for bar_bla_bla\n";
     98    // checking that we return empty map for files not mentioned in config
     99    suite.out() << "props3" << std::endl;
     100    const std::map<std::string, std::string>& props3 =
     101      conf.svn_properties("nothing-nothing");
     102    suite.add(props3.empty());
     103  }
     104
    71105  void test_read_write(test::Suite& suite)
    72106  {
Note: See TracChangeset for help on using the changeset viewer.