[luabind-cvs] luabind/luabind/test test_object.cpp,1.29,1.30
Brought to you by:
arvidn,
daniel_wallin
From: Arvid N. <ar...@us...> - 2006-06-13 23:28:06
|
Update of /cvsroot/luabind/luabind/luabind/test In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv343/luabind/test Modified Files: test_object.cpp Log Message: added luabind::nil and assignment operators to handle it Index: test_object.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/test_object.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- test_object.cpp 26 Mar 2006 15:47:30 -0000 1.29 +++ test_object.cpp 13 Jun 2006 23:27:58 -0000 1.30 @@ -209,6 +209,31 @@ TEST_CHECK(iterator(t) == iterator()); TEST_CHECK(raw_iterator(t) == raw_iterator()); + t["foo"] = "bar"; + + TEST_CHECK(object_cast<std::string>(t["foo"]) == "bar"); + TEST_CHECK(object_cast<std::string>(*iterator(t)) == "bar"); + TEST_CHECK(object_cast<std::string>(*raw_iterator(t)) == "bar"); + + t["foo"] = nil; // luabind::nil_type + + TEST_CHECK(iterator(t) == iterator()); + TEST_CHECK(raw_iterator(t) == raw_iterator()); + + t["foo"] = "bar"; + iterator it1(t); + *it1 = nil; + + TEST_CHECK(iterator(t) == iterator()); + TEST_CHECK(raw_iterator(t) == raw_iterator()); + + t["foo"] = "bar"; + raw_iterator it2(t); + *it2 = nil; + + TEST_CHECK(iterator(t) == iterator()); + TEST_CHECK(raw_iterator(t) == raw_iterator()); + DOSTRING(L, "p1 = {}\n" "p2 = {}\n" |