source: trunk/test/date.cc

Last change on this file was 1164, checked in by Peter Johansson, 11 years ago

improve lazycheck dependencies

To allow editing dependencies, the tests must have a suffix mentioned
in TEST_EXTENSION and it seems smoother if this suffix starts with a
period (.). Therefore tests are now named foo.test (rather than
foo_test before) and corresponding source is named foo.cc (rather than
foo_test.cc before). The change is documented in section 'Writing C++
tests' in test/README.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.2 KB
RevLine 
[396]1// $Id: date.cc 1164 2010-08-13 20:21:40Z peter $
2
3/*
[978]4  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
[1127]5  Copyright (C) 2010 Peter Johansson
[396]6
[687]7  This file is part of svndigest, http://dev.thep.lu.se/svndigest
[396]8
9  svndigest is free software; you can redistribute it and/or modify it
10  under the terms of the GNU General Public License as published by
[693]11  the Free Software Foundation; either version 3 of the License, or
[396]12  (at your option) any later version.
13
14  svndigest is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  General Public License for more details.
18
19  You should have received a copy of the GNU General Public License
[693]20  along with svndigest. If not, see <http://www.gnu.org/licenses/>.
[396]21*/
22
[1162]23#include "Suite.h"
24
[1119]25#include "lib/Date.h"
[396]26
27#include <iostream>
28#include <string>
29
[1162]30int main(int argc, char* argv[])
[396]31{
32  using namespace theplu::svndigest;
[1162]33  test::Suite suite(argc, argv);
[396]34
35  Date date("2007-06-27T15:40:52.123456Z");
36  if (date("%H:%M")!="15:40"){
[1162]37    suite.add(false);
[396]38    std::cerr << "date(\"%H:%M\") returns: " << date("%H:%M")
39              << "\nexpected '15:40'" << std::endl;
40  }
41     
[1162]42  return suite.exit_status();
[396]43}
44
Note: See TracBrowser for help on using the repository browser.