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
Line 
1// $Id: date.cc 1164 2010-08-13 20:21:40Z peter $
2
3/*
4  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
5  Copyright (C) 2010 Peter Johansson
6
7  This file is part of svndigest, http://dev.thep.lu.se/svndigest
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
11  the Free Software Foundation; either version 3 of the License, or
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
20  along with svndigest. If not, see <http://www.gnu.org/licenses/>.
21*/
22
23#include "Suite.h"
24
25#include "lib/Date.h"
26
27#include <iostream>
28#include <string>
29
30int main(int argc, char* argv[])
31{
32  using namespace theplu::svndigest;
33  test::Suite suite(argc, argv);
34
35  Date date("2007-06-27T15:40:52.123456Z");
36  if (date("%H:%M")!="15:40"){
37    suite.add(false);
38    std::cerr << "date(\"%H:%M\") returns: " << date("%H:%M")
39              << "\nexpected '15:40'" << std::endl;
40  }
41     
42  return suite.exit_status();
43}
44
Note: See TracBrowser for help on using the repository browser.