Yield orchestrators for child groups and correct subscription context catalogs
This commit is contained in:
Vendored
+2
-57
@@ -340,60 +340,5 @@ impl<B> BlockDescriptor<B> {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use test_utils::*;
|
||||
use super::{ConcreteBlock, RcBlock};
|
||||
|
||||
#[test]
|
||||
fn test_call_block() {
|
||||
let block = get_int_block_with(13);
|
||||
unsafe {
|
||||
assert!(block.call(()) == 13);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_call_block_args() {
|
||||
let block = get_add_block_with(13);
|
||||
unsafe {
|
||||
assert!(block.call((2,)) == 15);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_create_block() {
|
||||
let block = ConcreteBlock::new(|| 13);
|
||||
let result = invoke_int_block(&block);
|
||||
assert!(result == 13);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_create_block_args() {
|
||||
let block = ConcreteBlock::new(|a: i32| a + 5);
|
||||
let result = invoke_add_block(&block, 6);
|
||||
assert!(result == 11);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_concrete_block_copy() {
|
||||
let s = "Hello!".to_string();
|
||||
let expected_len = s.len() as i32;
|
||||
let block = ConcreteBlock::new(move || s.len() as i32);
|
||||
assert!(invoke_int_block(&block) == expected_len);
|
||||
|
||||
let copied = block.copy();
|
||||
assert!(invoke_int_block(&copied) == expected_len);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_concrete_block_stack_copy() {
|
||||
fn make_block() -> RcBlock<(), i32> {
|
||||
let x = 7;
|
||||
let block = ConcreteBlock::new(move || x);
|
||||
block.copy()
|
||||
}
|
||||
|
||||
let block = make_block();
|
||||
assert!(invoke_int_block(&block) == 7);
|
||||
}
|
||||
}
|
||||
#[path = "lib_tests.rs"]
|
||||
mod tests;
|
||||
|
||||
Vendored
+55
@@ -0,0 +1,55 @@
|
||||
use test_utils::*;
|
||||
use super::{ConcreteBlock, RcBlock};
|
||||
|
||||
#[test]
|
||||
fn test_call_block() {
|
||||
let block = get_int_block_with(13);
|
||||
unsafe {
|
||||
assert!(block.call(()) == 13);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_call_block_args() {
|
||||
let block = get_add_block_with(13);
|
||||
unsafe {
|
||||
assert!(block.call((2,)) == 15);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_create_block() {
|
||||
let block = ConcreteBlock::new(|| 13);
|
||||
let result = invoke_int_block(&block);
|
||||
assert!(result == 13);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_create_block_args() {
|
||||
let block = ConcreteBlock::new(|a: i32| a + 5);
|
||||
let result = invoke_add_block(&block, 6);
|
||||
assert!(result == 11);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_concrete_block_copy() {
|
||||
let s = "Hello!".to_string();
|
||||
let expected_len = s.len() as i32;
|
||||
let block = ConcreteBlock::new(move || s.len() as i32);
|
||||
assert!(invoke_int_block(&block) == expected_len);
|
||||
|
||||
let copied = block.copy();
|
||||
assert!(invoke_int_block(&copied) == expected_len);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_concrete_block_stack_copy() {
|
||||
fn make_block() -> RcBlock<(), i32> {
|
||||
let x = 7;
|
||||
let block = ConcreteBlock::new(move || x);
|
||||
block.copy()
|
||||
}
|
||||
|
||||
let block = make_block();
|
||||
assert!(invoke_int_block(&block) == 7);
|
||||
}
|
||||
Reference in New Issue
Block a user