Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jul 22, 2023. It is now read-only.
/pythonnetPublic archive
forked frompythonnet/pythonnet

Commitde3874c

Browse files
committed
Add PyTuple Ctor tests
1 parent305040d commitde3874c

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

‎src/embed_tests/TestPyTuple.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,42 @@ public void TestPyTupleBadCtor()
5858
}
5959
}
6060

61+
[Test]
62+
publicvoidTestPyTupleCtorEmptyArray()
63+
{
64+
using(Py.GIL())
65+
{
66+
vara=newPyObject[]{};
67+
vart=newPyTuple(a);
68+
69+
Assert.AreEqual(0,t.Length());
70+
}
71+
}
72+
73+
[Test]
74+
publicvoidTestPyTupleCtorArrayPyIntEmpty()
75+
{
76+
using(Py.GIL())
77+
{
78+
vara=newPyInt[]{};
79+
vart=newPyTuple(a);
80+
81+
Assert.AreEqual(0,t.Length());
82+
}
83+
}
84+
85+
[Test]
86+
publicvoidTestPyTupleCtorArray()
87+
{
88+
using(Py.GIL())
89+
{
90+
vara=newPyObject[]{newPyInt(1),newPyString("Foo")};
91+
vart=newPyTuple(a);
92+
93+
Assert.AreEqual(2,t.Length());
94+
}
95+
}
96+
6197
/// <summary>
6298
/// Test PyTuple.Concat(...) doesn't let invalid appends happen
6399
/// and throws and exception.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp