/[debian]/mimetic/branches/upstream/current/test/t.strutils.h
ViewVC logotype

Contents of /mimetic/branches/upstream/current/test/t.strutils.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1729 - (show annotations)
Fri May 15 15:30:29 2009 UTC (12 years, 2 months ago) by gregoa
File MIME type: text/plain
File size: 961 byte(s)
[svn-upgrade] Integrating new upstream version, mimetic (0.9.6)
1 #ifndef _T_STRUTILS_H_
2 #define _T_STRUTILS_H_
3 #include <string>
4 #include <mimetic/strutils.h>
5 #include "cutee.h"
6
7
8 namespace mimetic
9 {
10
11 struct TEST_CLASS( testStrUtils )
12 {
13 void TEST_FUNCTION( test_remove_external_blanks )
14 {
15 struct test_item { const char *in, *out; };
16 test_item data[] = {
17 { "", "" },
18 { "a", "a" },
19 { "aaaabbbb", "aaaabbbb" },
20 { " a", "a" },
21 { "a ", "a" },
22 { " a ", "a" },
23 { " abcd ", "abcd" },
24 { "aaaabbbb", "aaaabbbb" },
25 { " aaaabbbb", "aaaabbbb" },
26 { " aaaabbbb ", "aaaabbbb" },
27 { 0, 0 }
28 };
29 for(int i = 0; data[i].in; ++i)
30 {
31 std::string s(data[i].in);
32 std::string r = remove_external_blanks(s);
33 TEST_ASSERT_EQUALS_P(r, data[i].out);
34
35 }
36
37 }
38 };
39
40 }
41
42 #endif
43

  ViewVC Help
Powered by ViewVC 1.1.26