Update of /cvsroot/boost/boost/libs/python/test
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16027/libs/python/test

Modified Files:
        exec.cpp 
Log Message:
Add new eval() function.

Index: exec.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/python/test/exec.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- exec.cpp    24 Jul 2006 22:25:35 -0000      1.6
+++ exec.cpp    2 May 2007 13:11:20 -0000       1.7
@@ -49,6 +49,13 @@
 }
 
 
+void eval_test()
+{
+  python::object result = python::eval("'abcdefg'.upper()");
+  std::string value = python::extract<std::string>(result) 
BOOST_EXTRACT_WORKAROUND;
+  BOOST_TEST(value == "ABCDEFG");
+}
+
 void exec_test()
 {
   // Register the module with the interpreter
@@ -108,7 +115,8 @@
   // Initialize the interpreter
   Py_Initialize();
 
-  if (python::handle_exception(exec_test) ||
+  if (python::handle_exception(eval_test) ||
+      python::handle_exception(exec_test) ||
       python::handle_exception(boost::bind(exec_file_test, script)))
   {
     if (PyErr_Occurred())


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to