-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue 43: Add package name to RustBufferI if it needs it
- Loading branch information
Showing
10 changed files
with
80 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* 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/. */ | ||
|
||
package binding_tests | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/NordSecurity/uniffi-bindgen-go/binding_tests/generated/issue43" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
// Ensure you can call async functions which return types in a different package. | ||
// See https://github.com/NordSecurity/uniffi-bindgen-go/issues/43 | ||
|
||
func TestIssue43(t *testing.T) { | ||
record := issue43.GetAsyncExternalType() | ||
assert.Equal(t, record.Id, "foo") | ||
assert.Equal(t, record.Tag, "bar") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "uniffi-go-fixture-issue43" | ||
version = "1.0.0" | ||
edition = "2021" | ||
publish = false | ||
|
||
[lib] | ||
crate-type = ["lib", "cdylib"] | ||
name = "uniffi_go_issue43" | ||
|
||
[dependencies] | ||
uniffi = {path = "../../../3rd-party/uniffi-rs/uniffi"} | ||
uniffi_macros = {path = "../../../3rd-party/uniffi-rs/uniffi_macros"} | ||
uniffi-go-fixture-issue45 = {path = "../issue45"} | ||
|
||
[build-dependencies] | ||
uniffi_build = {path = "../../../3rd-party/uniffi-rs/uniffi_build", features=["builtin-bindgen"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* 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/. */ | ||
|
||
fn main() { | ||
uniffi_build::generate_scaffolding("./src/issue43.udl").unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
namespace issue43 {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* 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/. */ | ||
|
||
#[uniffi::export] | ||
async fn get_async_external_type() -> uniffi_go_issue45::Record { | ||
uniffi_go_issue45::Record { | ||
id: "foo".to_string(), | ||
tag: "bar".to_string(), | ||
} | ||
} | ||
|
||
include!(concat!(env!("OUT_DIR"), "/issue43.uniffi.rs")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters