aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Stephen P. Bennett <spb@exherbo.org> 2006-01-23 02:27:40 +0000
committerAvatar Stephen P. Bennett <spb@exherbo.org> 2006-01-23 02:27:40 +0000
commit7c14cbaced4a71fb8dae281ced65c9be76d230c3 (patch)
treeb0ff2f6269449080a30489110577e5270c6ded6b
parentdcbdd26b9b38a691d45e74fe5add94cc4e835e80 (diff)
downloadpaludis-7c14cbaced4a71fb8dae281ced65c9be76d230c3.tar.gz
paludis-7c14cbaced4a71fb8dae281ced65c9be76d230c3.tar.xz
Test some failure conditions for destringify
-rw-r--r--paludis/destringify_TEST.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/paludis/destringify_TEST.cc b/paludis/destringify_TEST.cc
index 8e9c771..c86f20a 100644
--- a/paludis/destringify_TEST.cc
+++ b/paludis/destringify_TEST.cc
@@ -63,6 +63,7 @@ namespace test_cases
TEST_CHECK_EQUAL(destringify<float>("0.0"), 0.f);
TEST_CHECK_EQUAL(destringify<float>("0.1"), 0.1f);
TEST_CHECK_EQUAL(destringify<float>("-1.54"), -1.54f);
+ TEST_CHECK_THROWS(destringify<float>("I am a fish"), DestringifyError);
}
} test_case_destringify_float;
@@ -89,6 +90,8 @@ namespace test_cases
TEST_CHECK(!destringify<bool>("false"));
TEST_CHECK(!destringify<bool>("0"));
TEST_CHECK(!destringify<bool>("-1"));
+ TEST_CHECK_THROWS(destringify<bool>("flase"), DestringifyError);
+ TEST_CHECK_THROWS(destringify<bool>("432.2413"), DestringifyError);
}
} test_case_destringify_bool;
}