summaryrefslogtreecommitdiff
path: root/TalerTests
diff options
context:
space:
mode:
authorJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2021-01-28 22:45:57 -0500
committerJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2021-01-28 22:45:57 -0500
commit43a8d866a4703aac8c545562eb8e2d3a610c4f68 (patch)
tree2dcaf6be0cec33065860262f1cc209387de45ed0 /TalerTests
parent97b916f0c1baeb2d931bb9457b0f2e8b966c4964 (diff)
downloadtaler-ios-43a8d866a4703aac8c545562eb8e2d3a610c4f68.tar.gz
taler-ios-43a8d866a4703aac8c545562eb8e2d3a610c4f68.tar.bz2
taler-ios-43a8d866a4703aac8c545562eb8e2d3a610c4f68.zip
add node to swift/objc bridge
Diffstat (limited to 'TalerTests')
-rw-r--r--TalerTests/NodeWrapperTests.swift31
1 files changed, 31 insertions, 0 deletions
diff --git a/TalerTests/NodeWrapperTests.swift b/TalerTests/NodeWrapperTests.swift
new file mode 100644
index 0000000..e01f1e9
--- /dev/null
+++ b/TalerTests/NodeWrapperTests.swift
@@ -0,0 +1,31 @@
+//
+// NodeWrapperTests.swift
+// TalerTests
+//
+// Created by Jonathan Buchanan on 1/14/21.
+// Copyright © 2021 Taler. All rights reserved.
+//
+
+import XCTest
+@testable import Taler
+
+class NodeWrapperTests: XCTestCase {
+ var iono: Iono!
+
+ override func setUpWithError() throws {
+ iono = Iono()
+ }
+
+ override func tearDownWithError() throws {
+
+ }
+
+ func testEvalJS() throws {
+ XCTAssert("2" == iono.evalJS(source: "1 + 1"))
+ XCTAssert("36" == iono.evalJS(source: "6 * 6"))
+ XCTAssert("42" == iono.evalJS(source: "(()=>{let x = 42; return x;})()"))
+ XCTAssert("undefined" == iono.evalJS(source: "const myVal = 42"))
+ XCTAssert("43" == iono.evalJS(source: "myVal + 1"))
+ }
+
+}