X Tutup
using System.Linq; using System.Text; using NUnit.Framework; using Python.Runtime; namespace Python.EmbeddingTest { class TestPyIter { [Test] public void KeepOldObjects() { using (Py.GIL()) using (var testString = new PyString("hello world! !$%&/()=?")) { PyObject[] chars = testString.ToArray(); Assert.IsTrue(chars.Length > 1); string reconstructed = string.Concat(chars.Select(c => c.As())); Assert.AreEqual(testString.As(), reconstructed); } } } }
X Tutup