mirror of https://github.com/KLayout/klayout.git
Fixed unit tests (error messages now have the message class attached)
This commit is contained in:
parent
e766b12c3e
commit
ad114f6137
|
|
@ -45,7 +45,7 @@ TEST (basic)
|
|||
try {
|
||||
pya::PythonInterpreter::instance ()->eval_string ("raise Exception(\"an error\")");
|
||||
} catch (tl::ScriptError &ex) {
|
||||
EXPECT_EQ (ex.basic_msg (), std::string ("an error"));
|
||||
EXPECT_EQ (ex.basic_msg (), std::string ("Exception: an error"));
|
||||
EXPECT_EQ (ex.cls () == std::string ("exceptions.Exception") || ex.cls () == std::string ("Exception"), true);
|
||||
err = true;
|
||||
}
|
||||
|
|
@ -56,7 +56,7 @@ TEST (basic)
|
|||
try {
|
||||
pya::PythonInterpreter::instance ()->eval_string ("Quatsch");
|
||||
} catch (tl::ScriptError &ex) {
|
||||
EXPECT_EQ (ex.basic_msg (), std::string ("name 'Quatsch' is not defined"));
|
||||
EXPECT_EQ (ex.basic_msg (), std::string ("NameError: name 'Quatsch' is not defined"));
|
||||
EXPECT_EQ (ex.cls () == std::string ("exceptions.NameError") || ex.cls () == std::string ("NameError"), true);
|
||||
err = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ TEST (basic)
|
|||
try {
|
||||
rba::RubyInterpreter::instance ()->eval_string ("raise \"an error\"");
|
||||
} catch (tl::Exception &ex) {
|
||||
EXPECT_EQ (std::string (ex.msg (), 0, 8), std::string ("an error"));
|
||||
EXPECT_EQ (std::string (ex.msg (), 0, 22), std::string ("RuntimeError: an error"));
|
||||
err = true;
|
||||
}
|
||||
|
||||
|
|
@ -56,8 +56,8 @@ TEST (basic)
|
|||
try {
|
||||
rba::RubyInterpreter::instance ()->eval_string ("Quatsch");
|
||||
} catch (tl::Exception &ex) {
|
||||
EXPECT_EQ (std::string (ex.msg (), 0, 30) == std::string ("uninitialized constant Quatsch") ||
|
||||
std::string (ex.msg (), 0, 38) == std::string ("uninitialized constant Object::Quatsch"),
|
||||
EXPECT_EQ (std::string (ex.msg (), 0, 41) == std::string ("NameError: uninitialized constant Quatsch") ||
|
||||
std::string (ex.msg (), 0, 49) == std::string ("NameError: uninitialized constant Object::Quatsch"),
|
||||
true);
|
||||
err = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue