Skip to content

Commit 943ea33

Browse files
committed
check for any
Signed-off-by: Teo Koon Peng <[email protected]>
1 parent 25ec4f2 commit 943ea33

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/buffer/buffer_map.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ mod tests {
358358
let mut promise = context.command(|commands| {
359359
commands
360360
.request(
361-
(5_i64, 3.14_f64, "hello".to_string(), "world", ()),
361+
(5_i64, 3.14_f64, "hello".to_string(), "world", 42_i64),
362362
workflow,
363363
)
364364
.take_response()
@@ -370,6 +370,7 @@ mod tests {
370370
assert_eq!(value.float, 3.14);
371371
assert_eq!(value.string, "hello");
372372
assert_eq!(value.generic, "world");
373+
assert_eq!(*value.any.downcast::<i64>().unwrap(), 42);
373374
assert!(context.no_unhandled_errors());
374375
}
375376

@@ -382,7 +383,7 @@ mod tests {
382383
let buffer_f64 = builder.create_buffer(BufferSettings::default());
383384
let buffer_string = builder.create_buffer(BufferSettings::default());
384385
let buffer_generic = builder.create_buffer(BufferSettings::default());
385-
let buffer_any = builder.create_buffer::<()>(BufferSettings::default());
386+
let buffer_any = builder.create_buffer::<i64>(BufferSettings::default());
386387

387388
scope.input.chain(builder).fork_unzip((
388389
|chain: Chain<_>| chain.connect(buffer_i64.input_slot()),
@@ -406,7 +407,7 @@ mod tests {
406407
let mut promise = context.command(|commands| {
407408
commands
408409
.request(
409-
(5_i64, 3.14_f64, "hello".to_string(), "world", ()),
410+
(5_i64, 3.14_f64, "hello".to_string(), "world", 42_i64),
410411
workflow,
411412
)
412413
.take_response()
@@ -418,6 +419,7 @@ mod tests {
418419
assert_eq!(value.float, 3.14);
419420
assert_eq!(value.string, "hello");
420421
assert_eq!(value.generic, "world");
422+
assert_eq!(*value.any.downcast::<i64>().unwrap(), 42);
421423
assert!(context.no_unhandled_errors());
422424
}
423425

@@ -435,7 +437,7 @@ mod tests {
435437
let buffer_generic =
436438
JsonBuffer::from(builder.create_buffer::<String>(BufferSettings::default()));
437439
let buffer_any =
438-
JsonBuffer::from(builder.create_buffer::<()>(BufferSettings::default()));
440+
JsonBuffer::from(builder.create_buffer::<i64>(BufferSettings::default()));
439441

440442
let buffers = TestJoinedValue::select_buffers(
441443
buffer_i64.downcast_for_message().unwrap(),
@@ -466,7 +468,7 @@ mod tests {
466468
3.14_f64,
467469
"hello".to_string(),
468470
"world".to_string(),
469-
(),
471+
42_i64,
470472
),
471473
workflow,
472474
)
@@ -479,6 +481,7 @@ mod tests {
479481
assert_eq!(value.float, 3.14);
480482
assert_eq!(value.string, "hello");
481483
assert_eq!(value.generic, "world");
484+
assert_eq!(*value.any.downcast::<i64>().unwrap(), 42);
482485
assert!(context.no_unhandled_errors());
483486
}
484487

0 commit comments

Comments
 (0)