From 13216ef5b1e9914ad07ab170f82b1ba2ef1d8c8d Mon Sep 17 00:00:00 2001 From: Caleb Fletcher Date: Mon, 30 Dec 2024 22:55:10 +1100 Subject: [PATCH] Add integration test for using declarations for strings --- integration-tests/tests/integration_test.rs | 26 +++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/integration-tests/tests/integration_test.rs b/integration-tests/tests/integration_test.rs index 853e17b1b..3b81a6c52 100644 --- a/integration-tests/tests/integration_test.rs +++ b/integration-tests/tests/integration_test.rs @@ -12386,6 +12386,32 @@ fn test_cpp_union_pod() { run_test_expect_fail("", hdr, quote! {}, &[], &["CorrelationId_t_"]); } +#[test] +fn test_using_string_function() { + let hdr = indoc! {" + #include + using std::string; + void foo(const string &a); + "}; + let rs = quote! {}; + run_test("", hdr, rs, &["foo"], &[]); +} + +#[test] +fn test_using_string_method() { + let hdr = indoc! {" + #include + using std::string; + class Foo + { + public: + Foo bar(const string &a); + }; + "}; + let rs = quote! {}; + run_test("", hdr, rs, &["Foo"], &[]); +} + #[test] #[ignore] // https://github.com/google/autocxx/issues/1382 fn test_override_typedef_fn() {