Skip to content

Commit a65b80c

Browse files
author
Pat Hickey
committed
unions tests: fix bugs in wasm.rs and host.py
i am skeptical about the python embedding, these tests shouldnt have passed before
1 parent 0469f4e commit a65b80c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/runtime/unions/host.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def add_one_float(self, num: i.AllFloats) -> i.AllFloats:
6969
def replace_first_char(self, text: i.AllText, letter: str) -> i.AllText:
7070
if isinstance(text, i.AllText0):
7171
return i.AllText0(letter)
72-
if isinstance(text, i.AllFloats1):
72+
if isinstance(text, i.AllText1):
7373
return i.AllText1(letter + text.value[1:])
7474
else:
7575
raise ValueError("Invalid input value!")
@@ -111,7 +111,7 @@ def identify_float(self, num: i.AllFloats) -> int:
111111
def identify_text(self, text: i.AllText) -> int:
112112
if isinstance(text, i.AllText0):
113113
return 0
114-
if isinstance(text, i.AllFloats1):
114+
if isinstance(text, i.AllText1):
115115
return 1
116116
else:
117117
raise ValueError("Invalid input value!")

tests/runtime/unions/wasm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl exports::Exports for Exports {
138138

139139
assert!(matches!(identify_duplicated(DuplicatedS32::I320(0)), 0));
140140
assert!(matches!(identify_duplicated(DuplicatedS32::I321(0)), 1));
141-
assert!(matches!(identify_duplicated(DuplicatedS32::I321(0)), 2));
141+
assert!(matches!(identify_duplicated(DuplicatedS32::I322(0)), 2));
142142

143143
// Distinguishable
144144
assert!(

0 commit comments

Comments
 (0)