mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-24 14:11:32 +00:00
update tests to use backend as in cache key gen
This commit is contained in:
@ -20,6 +20,7 @@ pub use wasmer_runtime_core::cache::{Artifact, Cache, WasmHash, WASMER_VERSION_H
|
||||
///
|
||||
/// ```rust
|
||||
/// use wasmer_runtime::cache::{Cache, FileSystemCache, WasmHash};
|
||||
/// use wasmer_runtime_core::backend::Backend;
|
||||
///
|
||||
/// # use wasmer_runtime::{Module, error::CacheError};
|
||||
/// fn store_module(module: Module) -> Result<Module, CacheError> {
|
||||
@ -28,7 +29,7 @@ pub use wasmer_runtime_core::cache::{Artifact, Cache, WasmHash, WASMER_VERSION_H
|
||||
/// // corrupted or tampered with.
|
||||
/// let mut fs_cache = unsafe { FileSystemCache::new("some/directory/goes/here")? };
|
||||
/// // Compute a key for a given WebAssembly binary
|
||||
/// let key = WasmHash::generate(&[]);
|
||||
/// let key = WasmHash::generate(&[], Backend::Cranelift);
|
||||
/// // Store a module into the cache given a key
|
||||
/// fs_cache.store(key, module.clone())?;
|
||||
/// Ok(module)
|
||||
@ -119,6 +120,7 @@ mod tests {
|
||||
|
||||
use super::*;
|
||||
use std::env;
|
||||
use wasmer_runtime_core::backend::Backend;
|
||||
|
||||
#[test]
|
||||
fn test_file_system_cache_run() {
|
||||
@ -147,7 +149,7 @@ mod tests {
|
||||
.unwrap()
|
||||
};
|
||||
// store module
|
||||
let key = WasmHash::generate(&wasm);
|
||||
let key = WasmHash::generate(&wasm, Backend::Cranelift);
|
||||
fs_cache.store(key, module.clone()).unwrap();
|
||||
|
||||
// load module
|
||||
|
Reference in New Issue
Block a user