update tests to use backend as in cache key gen

This commit is contained in:
Mark McCaskey
2019-07-08 11:11:27 -07:00
parent b746a88138
commit f45d523012
2 changed files with 9 additions and 4 deletions

View File

@ -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