Skip to content

Commit 2dae59d

Browse files
committed
fix assert_instr for non-wasm targets
1 parent 7775180 commit 2dae59d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

crates/stdsimd-test/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,12 @@ fn normalize(symbol: &str) -> String {
362362
/// This asserts that the function at `fnptr` contains the instruction
363363
/// `expected` provided.
364364
pub fn assert(fnptr: usize, fnname: &str, expected: &str) {
365+
// The string in expected is surrounded by '"', strip these:
366+
let expected = {
367+
assert!(expected.len() > 2 && expected.starts_with('"')
368+
&& expected.ends_with('"'));
369+
expected.get(1..expected.len()-1).unwrap()
370+
};
365371
let mut fnname = fnname.to_string();
366372
let functions = get_functions(fnptr, &mut fnname);
367373
assert_eq!(functions.len(), 1);

0 commit comments

Comments
 (0)