We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 93adecc commit 8848f84Copy full SHA for 8848f84
Tests/PythonKitTests/PythonRuntimeTests.swift
@@ -326,4 +326,16 @@ class PythonRuntimeTests: XCTestCase {
326
}
327
XCTAssertEqual(bytes, otherBytes)
328
329
+
330
+ func testPythonFunction() {
331
+ let pythonAdd = PythonFunction { (params: [PythonObject]) in
332
+ let lhs = params[0]
333
+ let rhs = params[1]
334
+ return lhs + rhs
335
+ }.pythonObject
336
337
+ let pythonSum = pythonAdd(2, 3)
338
+ XCTAssertNotNil(Double(pythonSum))
339
+ XCTAssertEqual(pythonSum, 5)
340
+ }
341
0 commit comments