Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix all exceptions
  • Loading branch information
koubaa committed Feb 17, 2021
commit 085c6656320dafb4503dad08d897fa0ece2d6f35
8 changes: 4 additions & 4 deletions src/embed_tests/Codecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public void ListDecoderTest()
IList<string> stringList = null;
Assert.DoesNotThrow(() => { codec.TryDecode(pyList, out stringList); });
Assert.AreEqual(stringList.Count, 3);
Assert.Throws(typeof(PythonException), () => { var x = stringList[0]; });
Assert.Throws(typeof(InvalidCastException), () => { var x = stringList[0]; });

//can't convert python iterable to list (this will require a copy which isn't lossless)
var foo = GetPythonIterable();
Expand Down Expand Up @@ -204,7 +204,7 @@ public void SequenceDecoderTest()
ICollection<string> stringCollection = null;
Assert.DoesNotThrow(() => { codec.TryDecode(pyList, out stringCollection); });
Assert.AreEqual(3, stringCollection.Count());
Assert.Throws(typeof(PythonException), () => {
Assert.Throws(typeof(InvalidCastException), () => {
string[] array = new string[3];
stringCollection.CopyTo(array, 0);
});
Expand Down Expand Up @@ -241,7 +241,7 @@ public void SequenceDecoderTest()
ICollection<string> stringCollection2 = null;
Assert.DoesNotThrow(() => { codec.TryDecode(pyTuple, out stringCollection2); });
Assert.AreEqual(3, stringCollection2.Count());
Assert.Throws(typeof(PythonException), () => {
Assert.Throws(typeof(InvalidCastException), () => {
string[] array = new string[3];
stringCollection2.CopyTo(array, 0);
});
Expand Down Expand Up @@ -296,7 +296,7 @@ public void IterableDecoderTest()
var x = item;
}
});
Assert.Throws(typeof(PythonException), () => {
Assert.Throws(typeof(InvalidCastException), () => {
stringEnumerable.Count();
});

Expand Down