| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ea44eef commit 2dfff9f
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,10 +24,10 @@ public void Dispose() | |||
| 24 | 24 | public void TestRunSimpleString() | |
| 25 | 25 | { | |
| 26 | 26 | int aa = PythonEngine.RunSimpleString("import sys"); | |
| 27 | - Assert.AreEqual(aa, 0); | ||
| 27 | + Assert.AreEqual(0, aa); | ||
| 28 | 28 | ||
| 29 | 29 | int bb = PythonEngine.RunSimpleString("import 1234"); | |
| 30 | - Assert.AreEqual(bb, -1); | ||
| 30 | + Assert.AreEqual(-1, bb); | ||
| 31 | 31 | } | |
| 32 | 32 | ||
| 33 | 33 | [Test] | |
@@ -40,8 +40,8 @@ public void TestEval() | |||
| 40 | 40 | locals.SetItem("a", new PyInt(10)); | |
| 41 | 41 | ||
| 42 | 42 | object b = PythonEngine.Eval("sys.attr1 + a + 1", null, locals.Handle) | |
| 43 | - .AsManagedObject(typeof(Int32)); | ||
| 44 | - Assert.AreEqual(b, 111); | ||
| 43 | + .AsManagedObject(typeof(int)); | ||
| 44 | + Assert.AreEqual(111, b); | ||
| 45 | 45 | } | |
| 46 | 46 | ||
| 47 | 47 | [Test] | |
@@ -54,8 +54,8 @@ public void TestExec() | |||
| 54 | 54 | locals.SetItem("a", new PyInt(10)); | |
| 55 | 55 | ||
| 56 | 56 | PythonEngine.Exec("c = sys.attr1 + a + 1", null, locals.Handle); | |
| 57 | - object c = locals.GetItem("c").AsManagedObject(typeof(Int32)); | ||
| 58 | - Assert.AreEqual(c, 111); | ||
| 57 | + object c = locals.GetItem("c").AsManagedObject(typeof(int)); | ||
| 58 | + Assert.AreEqual(111, c); | ||
| 59 | 59 | } | |
| 60 | 60 | } | |
| 61 | 61 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -432,7 +432,7 @@ public static void Exec(string code, IntPtr? globals = null, IntPtr? locals = nu | |||
| 432 | 432 | /// executing the code string as a PyObject instance, or null if | |
| 433 | 433 | /// an exception was raised. | |
| 434 | 434 | /// </remarks> | |
| 435 | - internal static PyObject RunString( | ||
| 435 | + public static PyObject RunString( | ||
| 436 | 436 | string code, IntPtr? globals = null, IntPtr? locals = null, RunFlagType _flag = RunFlagType.File | |
| 437 | 437 | ) | |
| 438 | 438 | { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments