summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <ecoal95@gmail.com>2016-10-14 14:19:12 +0200
committerEmilio Cobos Álvarez <ecoal95@gmail.com>2016-10-18 15:55:43 +0200
commit30028f9e3f51fd8b752c594328b170a23f58abd4 (patch)
treed4ac66e0bce3a287e9aac1c124a4fb7a0b46d6c5 /tests
parentdb32040baa632682b6f2ff5d533e5d6ffbe7a003 (diff)
Tests
Diffstat (limited to 'tests')
-rw-r--r--tests/expectations/template_alias.rs12
-rw-r--r--tests/expectations/template_alias_basic.rs7
-rw-r--r--tests/expectations/template_alias_namespace.rs21
-rw-r--r--tests/headers/template_alias.hpp13
-rw-r--r--tests/headers/template_alias_basic.hpp4
-rw-r--r--tests/headers/template_alias_namespace.hpp13
6 files changed, 70 insertions, 0 deletions
diff --git a/tests/expectations/template_alias.rs b/tests/expectations/template_alias.rs
new file mode 100644
index 00000000..6457381f
--- /dev/null
+++ b/tests/expectations/template_alias.rs
@@ -0,0 +1,12 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(non_snake_case)]
+
+
+pub type Wrapped<T> = T;
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct Rooted<T> {
+ pub ptr: Wrapped<T>,
+}
diff --git a/tests/expectations/template_alias_basic.rs b/tests/expectations/template_alias_basic.rs
new file mode 100644
index 00000000..656fff33
--- /dev/null
+++ b/tests/expectations/template_alias_basic.rs
@@ -0,0 +1,7 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(non_snake_case)]
+
+
+pub type Wrapped<T> = T;
diff --git a/tests/expectations/template_alias_namespace.rs b/tests/expectations/template_alias_namespace.rs
new file mode 100644
index 00000000..475c2b05
--- /dev/null
+++ b/tests/expectations/template_alias_namespace.rs
@@ -0,0 +1,21 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(non_snake_case)]
+
+
+pub mod root {
+ use root;
+ pub mod JS {
+ use root;
+ pub mod detail {
+ use root;
+ pub type Wrapped<T> = T;
+ }
+ #[repr(C)]
+ #[derive(Debug, Copy, Clone)]
+ pub struct Rooted<T> {
+ pub ptr: root::JS::detail::Wrapped<T>,
+ }
+ }
+}
diff --git a/tests/headers/template_alias.hpp b/tests/headers/template_alias.hpp
new file mode 100644
index 00000000..646d9f40
--- /dev/null
+++ b/tests/headers/template_alias.hpp
@@ -0,0 +1,13 @@
+// bindgen-flags: -- -std=c++14
+
+namespace JS {
+namespace detail {
+ template <typename T>
+ using Wrapped = T;
+}
+
+template <typename T>
+struct Rooted {
+ detail::Wrapped<T> ptr;
+};
+}
diff --git a/tests/headers/template_alias_basic.hpp b/tests/headers/template_alias_basic.hpp
new file mode 100644
index 00000000..964f6e27
--- /dev/null
+++ b/tests/headers/template_alias_basic.hpp
@@ -0,0 +1,4 @@
+// bindgen-flags: -- -std=c++11
+
+template<typename T>
+using Wrapped = T;
diff --git a/tests/headers/template_alias_namespace.hpp b/tests/headers/template_alias_namespace.hpp
new file mode 100644
index 00000000..bd637166
--- /dev/null
+++ b/tests/headers/template_alias_namespace.hpp
@@ -0,0 +1,13 @@
+// bindgen-flags: --enable-cxx-namespaces -- -std=c++14
+
+namespace JS {
+namespace detail {
+ template <typename T>
+ using Wrapped = T;
+}
+
+template <typename T>
+struct Rooted {
+ detail::Wrapped<T> ptr;
+};
+}