Skip to content

Commit f2fc254

Browse files
committed
test: Fix panic in zip_with test
1 parent d6920fa commit f2fc254

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

tests/main.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -151,23 +151,10 @@ struct TestEffIO;
151151

152152
define_test_type! { TestEffIO A }
153153

154-
struct GluonTestable<F>(F);
155-
156-
impl<F> tensile::Testable for GluonTestable<F>
157-
where
158-
F: Future<Output = Result<(), Error>> + Send + 'static,
159-
{
160-
type Error = Error;
161-
162-
fn test(self) -> tensile::TestFuture<Self::Error> {
163-
tensile::Future(self.0).test()
164-
}
165-
}
166-
167154
fn make_tensile_test(name: String, test: TestFn) -> tensile::Test<Error> {
168155
let mut test = ::std::panic::AssertUnwindSafe(test);
169156
tensile::test(name, {
170-
GluonTestable(::std::panic::AssertUnwindSafe(async move {
157+
tensile::Future(::std::panic::AssertUnwindSafe(async move {
171158
let test = test.call_async(()).await?;
172159
let action = test.vm().get_global("std.test.run_io")?;
173160
let mut action: OwnedFunction<fn(OpaqueValue<RootedThread, TestEffIO>) -> IO<()>> =

vm/src/thread.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,15 +1260,15 @@ impl ThreadInternal for Thread {
12601260
);
12611261
e.call_state = ExternCallState::Poll
12621262
}
1263-
_ => unreachable!("{:#?}", frame.state),
1263+
_ => (),
12641264
}
12651265
}
12661266
}
12671267
if context.stack.get_frames().len() == 1 {
12681268
// Only the top level frame left means that the thread has finished
12691269
return Err(Error::Dead).into();
12701270
}
1271-
context = ready!(context.execute(cx))?.unwrap();
1271+
context = ready!(context.execute(cx))?.expect("Resume called on the top frame");
12721272
Ok(context).into()
12731273
}
12741274

0 commit comments

Comments
 (0)