summaryrefslogtreecommitdiffstats
path: root/vendor/wasm-bindgen/tests/wasm/enums.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/wasm-bindgen/tests/wasm/enums.rs')
-rw-r--r--vendor/wasm-bindgen/tests/wasm/enums.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/vendor/wasm-bindgen/tests/wasm/enums.rs b/vendor/wasm-bindgen/tests/wasm/enums.rs
index 959a3e271..7c652273b 100644
--- a/vendor/wasm-bindgen/tests/wasm/enums.rs
+++ b/vendor/wasm-bindgen/tests/wasm/enums.rs
@@ -10,6 +10,7 @@ extern "C" {
fn js_expect_enum(x: Color, y: Option<Color>);
fn js_expect_enum_none(x: Option<Color>);
fn js_renamed_enum(b: RenamedEnum);
+ fn js_enum_with_error_variant();
}
#[wasm_bindgen]
@@ -71,6 +72,14 @@ pub fn handle_optional_enums(x: Option<Color>) -> Option<Color> {
x
}
+#[wasm_bindgen]
+#[derive(Copy, Clone)]
+pub enum EnumWithErrorVariant {
+ OK,
+ Warning,
+ Error,
+}
+
#[wasm_bindgen_test]
fn test_optional_enums() {
use self::Color::*;
@@ -95,3 +104,8 @@ fn test_optional_enum_values() {
fn test_renamed_enum() {
js_renamed_enum(RenamedEnum::B);
}
+
+#[wasm_bindgen_test]
+fn test_enum_with_error_variant() {
+ js_enum_with_error_variant();
+}