The following assert will fail because the memory storage will create a new operator every time. To maintain the context, we should create the operator at init and clone it later.
#[tokio::test]
async fn test_memory_io() {
let io = FileIOBuilder::new("memory").build().unwrap();
//let io = create_local_file_io();
let path = format!(
"{}/1.txt",
TempDir::new().unwrap().path().to_str().unwrap()
);
let output_file = io
.new_output(path.clone())
.unwrap();
output_file.write("test".into()).await.unwrap();
assert!(io.is_exist(path.clone()).await.unwrap());
}
The following assert will fail because the memory storage will create a new operator every time. To maintain the context, we should create the operator at init and clone it later.