Make information on source and target types in Type Conversion

Exception public.
This commit is contained in:
Alek Mosingiewicz 2018-08-13 17:57:38 +02:00
parent eb3ee28cee
commit a254e11286

View File

@ -1354,7 +1354,7 @@ TEST_CASE("Test ability to get 'use' function from default construction")
const auto use_function = chai.eval<std::function<chaiscript::Boxed_Value (const std::string &)>>("use");
}
TEST_CASE("Throw an exception when trying to add one conversion twice")
TEST_CASE("Throw an exception when trying to add same conversion twice")
{
struct my_int {
int value;
@ -1363,11 +1363,11 @@ TEST_CASE("Throw an exception when trying to add one conversion twice")
chaiscript::ChaiScript chai;
chai.add(chaiscript::type_conversion<int, my_int>([](int x) {
std::cout << "Foo type conversion 1\n";
std::cout << "My_int type conversion 1\n";
return my_int(x);
}));
CHECK_THROWS_AS(chai.add(chaiscript::type_conversion<int, my_int>([](int x) {
std::cout << "Foo type conversion 2\n";
std::cout << "My_int type conversion 2\n";
return my_int(x);
})), chaiscript::exception::conversion_error);