Skip to content

Commit b5f73ba

Browse files
committed
moved new tests into own directory
1 parent ab8b1ed commit b5f73ba

File tree

5 files changed

+74
-27
lines changed

5 files changed

+74
-27
lines changed

tests-e2e/reference_output/test1/test1.d.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
11
/* tslint:disable */
22
/* eslint-disable */
33
/**
4-
* @param {Point} point
5-
*/
6-
export function consume(point: Point): void;
7-
/**
84
* @returns {Point}
95
*/
106
export function into_js(): Point;
11-
/**
12-
* @param {(Point)[]} points
13-
*/
14-
export function consume_vector(points: (Point)[]): void;
15-
/**
16-
* @returns {(Point)[]}
17-
*/
18-
export function vector_into_js(): (Point)[];
197
export interface Point {
208
x: number;
219
y: number;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* @param {Point} point
5+
*/
6+
export function consume(point: Point): void;
7+
/**
8+
* @returns {Point}
9+
*/
10+
export function into_js(): Point;
11+
/**
12+
* @param {(Point)[]} points
13+
*/
14+
export function consume_vector(points: (Point)[]): void;
15+
/**
16+
* @returns {(Point)[]}
17+
*/
18+
export function vector_into_js(): (Point)[];
19+
export interface Point {
20+
x: number;
21+
y: number;
22+
}
23+

tests-e2e/test1/entry_point.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,7 @@ pub struct Point {
99
y: i32,
1010
}
1111

12-
#[wasm_bindgen]
13-
pub fn consume(point: Point) {}
14-
1512
#[wasm_bindgen]
1613
pub fn into_js() -> Point {
1714
Point { x: 0, y: 0 }
1815
}
19-
20-
#[wasm_bindgen]
21-
pub fn consume_vector(points: Vec<Point>) {}
22-
23-
#[wasm_bindgen]
24-
pub fn vector_into_js() -> Vec<Point> {
25-
vec![
26-
Point { x: 1, y: 6 },
27-
Point { x: 2, y: 5 },
28-
Point { x: 3, y: 4 },
29-
]
30-
}

tests-e2e/test4/Cargo.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[package]
2+
name = "test4"
3+
publish = false
4+
version = "0.1.0"
5+
edition = "2021"
6+
7+
[dependencies]
8+
wasm-bindgen = "0.2"
9+
tsify-next = { path = "../..", version = "*" }
10+
serde = { version = "1.0", features = ["derive"] }
11+
serde_json = "1.0"
12+
13+
[dev-dependencies]
14+
wasm-bindgen-test = "0.3"
15+
16+
[lib]
17+
path = "entry_point.rs"
18+
crate-type = ["cdylib"]
19+
20+
[build-dependencies]
21+
wasm-bindgen-cli = "0.2"

tests-e2e/test4/entry_point.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
use serde::{Deserialize, Serialize};
2+
use tsify_next::Tsify;
3+
use wasm_bindgen::prelude::*;
4+
5+
#[derive(Tsify, Serialize, Deserialize)]
6+
#[tsify(into_wasm_abi, from_wasm_abi)]
7+
pub struct Point {
8+
x: i32,
9+
y: i32,
10+
}
11+
12+
#[wasm_bindgen]
13+
pub fn consume(point: Point) {}
14+
15+
#[wasm_bindgen]
16+
pub fn into_js() -> Point {
17+
Point { x: 0, y: 0 }
18+
}
19+
20+
#[wasm_bindgen]
21+
pub fn consume_vector(points: Vec<Point>) {}
22+
23+
#[wasm_bindgen]
24+
pub fn vector_into_js() -> Vec<Point> {
25+
vec![
26+
Point { x: 1, y: 6 },
27+
Point { x: 2, y: 5 },
28+
Point { x: 3, y: 4 },
29+
]
30+
}

0 commit comments

Comments
 (0)