2019-03-19 12:38:22 +11:00
|
|
|
#include "parse/value.hpp"
|
2017-07-26 15:25:29 +10:00
|
|
|
#include "tap.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
int
|
|
|
|
main (void)
|
|
|
|
{
|
2018-08-05 14:42:02 +10:00
|
|
|
cruft::TAP::logger tap;
|
2017-07-26 15:25:29 +10:00
|
|
|
|
2019-03-19 12:38:22 +11:00
|
|
|
tap.expect_eq (cruft::parse::from_string<long> ("1"), 1L, "parsing long '1'");
|
|
|
|
tap.expect_throw<std::invalid_argument> ([] () { cruft::parse::from_string<long> ("a"); }, "parsing long 'a'");
|
2017-07-26 15:25:29 +10:00
|
|
|
|
2019-03-19 12:38:22 +11:00
|
|
|
tap.expect_eq (cruft::parse::from_string<float> ("1"), 1.f, "parsing float '1'");
|
|
|
|
tap.expect_throw<std::invalid_argument> ([] () { cruft::parse::from_string<float> ("a"); }, "parsing float 'a'");
|
2017-07-26 15:25:29 +10:00
|
|
|
|
|
|
|
return tap.status ();
|
|
|
|
}
|