Code

switch to sigc++ signal for "release"
[inkscape.git] / src / extract-uri-test.h
2 #ifndef SEEN_EXTRACT_URI_TEST_H
3 #define SEEN_EXTRACT_URI_TEST_H
5 #include <cxxtest/TestSuite.h>
7 #include "extract-uri.h"
9 class ExtractURITest : public CxxTest::TestSuite
10 {
11 public:
12     void testBase()
13     {
14         char const* cases[][2] = {
15             { "url(#foo)", "#foo" },
16             { "url  foo  ", "foo" },
17             { "url", NULL },
18             { "url ", NULL },
19             { "url()", NULL },
20             { "url ( ) ", NULL },
21             { "url foo bar ", "foo bar" }
22         };
24         for ( size_t i = 0; i < G_N_ELEMENTS(cases); i++ )
25         {
26             char const* result = extract_uri( cases[i][0] );
28             TS_ASSERT_EQUALS( ( result == NULL ), ( cases[i][1] == NULL ) );
29             if ( result )
30             {
31                 TS_ASSERT_EQUALS( std::string(result), std::string(cases[i][1]) );
32             }
33         }
34     }
36 };
38 #endif // SEEN_EXTRACT_URI_TEST_H
40 /*
41   Local Variables:
42   mode:c++
43   c-file-style:"stroustrup"
44   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
45   indent-tabs-mode:nil
46   fill-column:99
47   End:
48 */
49 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :