mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-29 05:41:57 +00:00
Convert SWIG typemap string operations to PythonObjects.
llvm-svn: 250530
This commit is contained in:
1 parent
a6760f98cf
commit
7d6d218e12
4 files changed
+100
-37
No files matched your search
@@ -382,3 +382,14 @@ TEST_F(PythonDataObjectsTest, TestPythonFile)
|
||||
PythonFile py_file(file, "r");
|
||||
EXPECT_TRUE(PythonFile::Check(py_file.get()));
|
||||
}
|
||||
|
||||
TEST_F(PythonDataObjectsTest, TestObjectAttributes)
|
||||
{
|
||||
PythonInteger py_int(42);
|
||||
EXPECT_TRUE(py_int.HasAttribute("numerator"));
|
||||
EXPECT_FALSE(py_int.HasAttribute("this_should_not_exist"));
|
||||
|
||||
PythonInteger numerator_attr = py_int.GetAttributeValue("numerator").AsType<PythonInteger>();
|
||||
EXPECT_TRUE(numerator_attr.IsAllocated());
|
||||
EXPECT_EQ(42, numerator_attr.GetInteger());
|
||||
}
|
||||
Reference in new issue
Block a user