Remove outer module
*
*/
-pub mod metacall {
use std::ffi::CString;
use std::os::raw::{c_char, c_double, c_float, c_int, c_long, c_short, c_void};
@@ -265,12 +264,11 @@ pub mod metacall {
metacall_destroy();
}
}
-}
/// Doc test to check if the code can build an run
#[cfg(test)]
mod tests {
- use super::*;
+ use crate::*;
struct Defer<F: FnOnce()>(Option<F>);
@@ -302,9 +300,9 @@ mod tests {
#[test]
fn test_metacall() {
- let _d = defer(|| metacall::destroy());
+ let _d = defer(|| crate::destroy());
- match metacall::initialize() {
+ match crate::initialize() {
Err(e) => {
println!("{}", e);
panic!();
@@ -314,7 +312,7 @@ mod tests {
let scripts: Vec<String> = vec!["test.mock".to_string()];
- match metacall::load_from_file("mock".to_string(), scripts) {
+ match crate::load_from_file("mock".to_string(), scripts) {
Err(e) => {
println!("{}", e);
panic!();
@@ -322,12 +320,12 @@ mod tests {
_ => (),
}
- match metacall::metacall(
+ match crate::metacall(
"new_args".to_string(),
- vec![metacall::Any::Str("a".to_string())],
+ vec![crate::Any::Str("a".to_string())],
) {
Ok(ret) => match ret {
- metacall::Any::Str(value) => {
+ crate::Any::Str(value) => {
assert_eq!("Hello World".to_string(), value);
println!("Result: {}", value);
}
