Skip to content

Commit

Permalink
Merge pull request rhaiscript#810 from silvergasp/fuzz-serde
Browse files Browse the repository at this point in the history
fuzz: Fix build
  • Loading branch information
schungx authored Jan 10, 2024
2 parents 9a79116 + 9d4d6a1 commit 2f2c385
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fuzz/fuzz_targets/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn fuzz(ctx: Ctx) -> Result<()> {
_ = black_box(ast.iter_functions().count());
_ = black_box(ast.iter_literal_variables(true, true).count());
_ = black_box(ast.walk(&mut |_| true));
_ = black_box(engine.gen_metadata_to_json(&ast, true));
_ = black_box(engine.gen_fn_metadata_with_ast_to_json(&ast, true));

let mut function_only_ast = ast.clone_functions_only();
assert!(function_only_ast.clear_functions().iter_functions().count() == 0);
Expand Down
5 changes: 3 additions & 2 deletions fuzz/fuzz_targets/fuzz_serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use rhai::{
};
use serde::{Deserialize, Serialize};

#[derive(Arbitrary, Debug, Clone, PartialEq, Serialize, Deserialize)]
enum Enum {
Normal,
Newtype(u8),
Expand All @@ -24,7 +25,7 @@ struct SubStruct {
struct NewType(u8);

#[derive(Arbitrary, Debug, Clone, PartialEq, Serialize, Deserialize)]
struct Tuple(u8, u8);
struct TupleStruct(u8, u8);

#[derive(Arbitrary, Debug, Clone, PartialEq, Serialize, Deserialize)]
struct AllTypes {
Expand Down Expand Up @@ -56,7 +57,7 @@ struct AllTypes {

_struct: SubStruct,
_new_type: NewType,
_tuple: Tuple,
_tuple_struct: TupleStruct,
_enum: Enum,
}

Expand Down

0 comments on commit 2f2c385

Please sign in to comment.