From a90a5cba08fdf6c0ceb95101c275108a152a3aed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:35:37 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- .../tests/bindings/test_custom_types.swift | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 toolkit/components/uniffi-fixtures/custom-types/tests/bindings/test_custom_types.swift (limited to 'toolkit/components/uniffi-fixtures/custom-types/tests/bindings/test_custom_types.swift') diff --git a/toolkit/components/uniffi-fixtures/custom-types/tests/bindings/test_custom_types.swift b/toolkit/components/uniffi-fixtures/custom-types/tests/bindings/test_custom_types.swift new file mode 100644 index 0000000000..5aaf6ff3b0 --- /dev/null +++ b/toolkit/components/uniffi-fixtures/custom-types/tests/bindings/test_custom_types.swift @@ -0,0 +1,20 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +import custom_types +import Foundation + +// TODO: use an actual test runner. + +do { + // Test simple values. + var demo = getCustomTypesDemo(demo: nil) + assert(demo.url == URL(string: "http://example.com/")) + assert(demo.handle == 123) + + // Change some data and ensure that the round-trip works + demo.url = URL(string: "http://new.example.com/")! + demo.handle = 456 + assert(demo == getCustomTypesDemo(demo: demo)) +} -- cgit v1.2.3