aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Mark Loeser <halcy0n@gentoo.org> 2006-01-17 05:37:38 +0000
committerAvatar Mark Loeser <halcy0n@gentoo.org> 2006-01-17 05:37:38 +0000
commit75e3b717da8cfbfdabdf26feb4cb202723738d7c (patch)
tree0b4a845fe0e6f6e51201ffb37b9bede710934017
parent257c29ad4b74799e3d183fc4457b820c65606e6e (diff)
downloadpaludis-75e3b717da8cfbfdabdf26feb4cb202723738d7c.tar.gz
paludis-75e3b717da8cfbfdabdf26feb4cb202723738d7c.tar.xz
Some simple testcases
-rw-r--r--paludis/is_file_with_extension_TEST.cc36
1 files changed, 35 insertions, 1 deletions
diff --git a/paludis/is_file_with_extension_TEST.cc b/paludis/is_file_with_extension_TEST.cc
index 49560c8..f9143ba 100644
--- a/paludis/is_file_with_extension_TEST.cc
+++ b/paludis/is_file_with_extension_TEST.cc
@@ -17,8 +17,42 @@ namespace test_cases
void run()
{
- /// \todo
+ IsFileWithExtension a("foo");
+ IsFileWithExtension b("cc");
+
+ FSEntry c("teh.foo");
+ FSEntry d("is_file_with_extension_TEST.cc");
+
+ TEST_CHECK( !a(c) );
+ TEST_CHECK( !a(d) );
+ TEST_CHECK( !b(c) );
+ TEST_CHECK( b(d) );
+
}
} test_is_file_with_extension;
+
+ struct IsFileWithExtensionPrefixTest : TestCase
+ {
+ IsFileWithExtensionPrefixTest() : TestCase("is file with extension (with prefix)") { }
+
+ void run()
+ {
+ IsFileWithExtension a("teh","foo");
+ IsFileWithExtension b("is", "cc");
+ IsFileWithExtension c("with", "cc");
+
+ FSEntry d("teh.foo");
+ FSEntry e("is_file_with_extension_TEST.cc");
+
+ TEST_CHECK( !a(d) );
+ TEST_CHECK( !a(e) );
+ TEST_CHECK( !b(d) );
+ TEST_CHECK( b(e) );
+ TEST_CHECK( !c(e) );
+
+ }
+ } test_is_file_with_extension_prefix;
+
+
}