Use starts_with for errors that always start with this string.

This commit is contained in:
Nick Lewycky
2021-05-07 11:14:50 -07:00
parent ac357e4a23
commit a84a4c2319
5 changed files with 15 additions and 5 deletions

View File

@ -48,7 +48,9 @@ fuzz_target!(|module: WasmSmithModule| {
Ok(_) => {}
Err(e) => {
let error_message = format!("{}", e);
if error_message.contains("RuntimeError: ") && error_message.contains("out of bounds") {
if error_message.starts_with("RuntimeError: ")
&& error_message.contains("out of bounds")
{
return;
}
panic!("{}", e);

View File

@ -48,7 +48,9 @@ fuzz_target!(|module: WasmSmithModule| {
Ok(_) => {}
Err(e) => {
let error_message = format!("{}", e);
if error_message.contains("RuntimeError: ") && error_message.contains("out of bounds") {
if error_message.starts_with("RuntimeError: ")
&& error_message.contains("out of bounds")
{
return;
}
panic!("{}", e);

View File

@ -56,7 +56,9 @@ fuzz_target!(|module: WasmSmithModule| {
Ok(_) => {}
Err(e) => {
let error_message = format!("{}", e);
if error_message.contains("RuntimeError: ") && error_message.contains("out of bounds") {
if error_message.starts_with("RuntimeError: ")
&& error_message.contains("out of bounds")
{
return;
}
panic!("{}", e);

View File

@ -62,7 +62,9 @@ fuzz_target!(|module: WasmSmithModule| {
Ok(_) => {}
Err(e) => {
let error_message = format!("{}", e);
if error_message.contains("RuntimeError: ") && error_message.contains("out of bounds") {
if error_message.starts_with("RuntimeError: ")
&& error_message.contains("out of bounds")
{
return;
}
panic!("{}", e);

View File

@ -53,7 +53,9 @@ fuzz_target!(|module: WasmSmithModule| {
Ok(_) => {}
Err(e) => {
let error_message = format!("{}", e);
if error_message.contains("RuntimeError: ") && error_message.contains("out of bounds") {
if error_message.starts_with("RuntimeError: ")
&& error_message.contains("out of bounds")
{
return;
}
panic!("{}", e);