| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -58,6 +58,42 @@ public void TestPyTupleBadCtor() | |||
| 58 | 58 | } | |
| 59 | 59 | } | |
| 60 | 60 | ||
| 61 | + [Test] | ||
| 62 | + public void TestPyTupleCtorEmptyArray() | ||
| 63 | + { | ||
| 64 | + using (Py.GIL()) | ||
| 65 | + { | ||
| 66 | + var a = new PyObject[] { }; | ||
| 67 | + var t = new PyTuple(a); | ||
| 68 | + | ||
| 69 | + Assert.AreEqual(0, t.Length()); | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + [Test] | ||
| 74 | + public void TestPyTupleCtorArrayPyIntEmpty() | ||
| 75 | + { | ||
| 76 | + using (Py.GIL()) | ||
| 77 | + { | ||
| 78 | + var a = new PyInt[] { }; | ||
| 79 | + var t = new PyTuple(a); | ||
| 80 | + | ||
| 81 | + Assert.AreEqual(0, t.Length()); | ||
| 82 | + } | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + [Test] | ||
| 86 | + public void TestPyTupleCtorArray() | ||
| 87 | + { | ||
| 88 | + using (Py.GIL()) | ||
| 89 | + { | ||
| 90 | + var a = new PyObject[] {new PyInt(1), new PyString("Foo") }; | ||
| 91 | + var t = new PyTuple(a); | ||
| 92 | + | ||
| 93 | + Assert.AreEqual(2, t.Length()); | ||
| 94 | + } | ||
| 95 | + } | ||
| 96 | + | ||
| 61 | 97 | /// <summary> | |
| 62 | 98 | /// Test PyTuple.Concat(...) doesn't let invalid appends happen | |
| 63 | 99 | /// and throws and exception. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments