Skip to content

Commit 0a4a202

Browse files
committed
Tests
1 parent 838be8e commit 0a4a202

6 files changed

+70
-0
lines changed

tests/expectations/template_alias.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* automatically generated by rust-bindgen */
2+
3+
4+
#![allow(non_snake_case)]
5+
6+
7+
pub type Wrapped<T> = T;
8+
#[repr(C)]
9+
#[derive(Debug, Copy, Clone)]
10+
pub struct Rooted<T> {
11+
pub ptr: Wrapped<T>,
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* automatically generated by rust-bindgen */
2+
3+
4+
#![allow(non_snake_case)]
5+
6+
7+
pub type Wrapped<T> = T;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* automatically generated by rust-bindgen */
2+
3+
4+
#![allow(non_snake_case)]
5+
6+
7+
pub mod root {
8+
use root;
9+
pub mod JS {
10+
use root;
11+
pub mod detail {
12+
use root;
13+
pub type Wrapped<T> = T;
14+
}
15+
#[repr(C)]
16+
#[derive(Debug, Copy, Clone)]
17+
pub struct Rooted<T> {
18+
pub ptr: root::JS::detail::Wrapped<T>,
19+
}
20+
}
21+
}

tests/headers/template_alias.hpp

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// bindgen-flags: -- -std=c++14
2+
3+
namespace JS {
4+
namespace detail {
5+
template <typename T>
6+
using Wrapped = T;
7+
}
8+
9+
template <typename T>
10+
struct Rooted {
11+
detail::Wrapped<T> ptr;
12+
};
13+
}
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// bindgen-flags: -- -std=c++11
2+
3+
template<typename T>
4+
using Wrapped = T;
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// bindgen-flags: --enable-cxx-namespaces -- -std=c++14
2+
3+
namespace JS {
4+
namespace detail {
5+
template <typename T>
6+
using Wrapped = T;
7+
}
8+
9+
template <typename T>
10+
struct Rooted {
11+
detail::Wrapped<T> ptr;
12+
};
13+
}

0 commit comments

Comments
 (0)