You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we can trim the testing code with a macro for calling the bif function.
During my development, the following codes were repeatedly entered.
let vm = vm::Machine::new();let module:*const module::Module = std::ptr::null();let process = process::allocate(&vm.state, module).wrap();let args = vec![xxxxxxx];let res = bif_the_function_I_want_to_test(&vm,&process,&args);
Most of the codes are not used for testing. The code duplication is so high that I think it can be replaced by a macro as a high order function like the following one.
macro_rules! test_it(func: func ; $($arg: expr),*) => {// The code as the above}
I can do this in Elixir but not sure if it is valid in Rust.
Does it sound a valid solution to you? @archseer
If it is okay, I will do it and refactor the unit tests.
The text was updated successfully, but these errors were encountered:
On Sun, 27 Jan 2019 at 20:36, Ryan, Siu Long Wa ***@***.***> wrote:
I think we can trim the testing code with a macro for calling the bif
function.
During my development, the following codes were repeatedly entered.
let vm = vm::Machine::new();let module: *const module::Module = std::ptr::null();let process = process::allocate(&vm.state, module).wrap();let args = vec![xxxxxxx];let res = bif_the_function_I_want_to_test(&vm, &process, &args);
Most of the codes are not used for testing. The code duplication is so
high that I think it can be replaced by a macro as a high order function
like the following one.
macro_rules! test_it(func: func ; $($arg: expr), *) => {
// The code as the above
}
I can do this in Elixir but not sure if it is valid in Rust.
Does it sound a valid solution to you? @archseer
<https://github.com/archseer>
If it is okay, I will do it and refactor the unit tests.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#27>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABTy9o48jJhoO70cD_a1FjRjrEyB8pAbks5vHY9JgaJpZM4aUq9F>
.
I think we can trim the testing code with a macro for calling the bif function.
During my development, the following codes were repeatedly entered.
Most of the codes are not used for testing. The code duplication is so high that I think it can be replaced by a macro as a high order function like the following one.
I can do this in Elixir but not sure if it is valid in Rust.
Does it sound a valid solution to you? @archseer
If it is okay, I will do it and refactor the unit tests.
The text was updated successfully, but these errors were encountered: