Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Next Next commit
Test convert error for float types
  • Loading branch information
amos402 committed Jul 29, 2020
commit 9845e98129dcdb83bc7ed44fee769a2d126733e2
9 changes: 8 additions & 1 deletion src/embed_tests/TestConverter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;

using NUnit.Framework;

using Python.Runtime;
Expand Down Expand Up @@ -63,9 +65,14 @@ public void TestConvertDoubleToManaged(
[Test]
public void CovertTypeError()
{
Type[] floatTypes = new Type[]
{
typeof(float),
typeof(double)
};
using (var s = new PyString("abc"))
{
foreach (var type in _numTypes)
foreach (var type in _numTypes.Union(floatTypes))
{
object value;
try
Expand Down