Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit 68cf078

Browse files
author
Stephen Hawley
committed
Checking reflection metadata
1 parent 6885aa3 commit 68cf078

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/tom-swifty-test/SwiftReflector/Swift4DemanglerTests.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,5 +1609,30 @@ public void TestExtensionDescriptor ()
16091609
Assert.IsNotNull (onType, "not a built in type");
16101610
Assert.AreEqual (CoreBuiltInType.Int, onType.BuiltInType, "not an int");
16111611
}
1612+
1613+
[Test]
1614+
public void TestReflectionMetadataField ()
1615+
{
1616+
var tld = Decomposer.Decompose ("_$s8itsAFive2E2OMF", false);
1617+
Assert.IsNotNull (tld, "failed decomposition");
1618+
var mdd = tld as TLMetadataDescriptor;
1619+
Assert.IsNotNull (mdd, "not a metadata descriptor");
1620+
var cl = mdd.OfType as SwiftClassType;
1621+
Assert.IsNotNull (cl, "not a class");
1622+
Assert.AreEqual ("itsAFive.E2", cl.ClassName.ToFullyQualifiedName (), "wrong name");
1623+
}
1624+
1625+
[Test]
1626+
public void TestReflectionMetadataBuiltin ()
1627+
{
1628+
var tld = Decomposer.Decompose ("_$s8itsAFive2E2OMB", false);
1629+
Assert.IsNotNull (tld, "failed decomposition");
1630+
var mdd = tld as TLMetadataDescriptor;
1631+
Assert.IsNotNull (mdd, "not a metadata descriptor");
1632+
Assert.IsTrue (mdd.IsBuiltIn, "not built in");
1633+
var cl = mdd.OfType as SwiftClassType;
1634+
Assert.IsNotNull (cl, "not a class");
1635+
Assert.AreEqual ("itsAFive.E2", cl.ClassName.ToFullyQualifiedName (), "wrong name");
1636+
}
16121637
}
16131638
}

0 commit comments

Comments
 (0)