Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
schungx committed May 15, 2024
1 parent 4ccb51e commit da1b662
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ Bug fixes
---------

* Variable resolver now correctly resolves variables that are captured in a closure.
* `NativeCallContext<'_>` (with a lifetime parameter) now parses correctly in the `#[export_module]` macro. This is to allow for `rust_2018_idioms` lints.
* `NativeCallContext<'_>` (with a lifetime parameter) now parses correctly in the `#[export_module]`
macro. This is to allow for `rust_2018_idioms` lints (thanks [`@ltabis`](https://github.com/ltabis) [864](https://github.com/rhaiscript/rhai/issues/864)).
* The `sync` feature now works properly in `no-std` builds (thanks [`@misssonder`](https://github.com/misssonder) [874](https://github.com/rhaiscript/rhai/pull/874)).

New features
------------
Expand Down
2 changes: 1 addition & 1 deletion benches/eval_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fn bench_eval_array_loop(bench: &mut Bencher) {
let script = "
let list = [];
for i in 0..10_000 {
for i in 0..1_888 {
list.push(i);
}
Expand Down
6 changes: 3 additions & 3 deletions benches/eval_expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ fn bench_eval_deeply_nested(bench: &mut Bencher) {
fn bench_eval_loop_number(bench: &mut Bencher) {
let script = "
let s = 0;
for x in 0..10000 {
for x in 0..1_888 {
s += 1;
}
";
Expand All @@ -142,7 +142,7 @@ fn bench_eval_loop_number(bench: &mut Bencher) {
fn bench_eval_loop_strings_build(bench: &mut Bencher) {
let script = r#"
let s;
for x in 0..10000 {
for x in 0..1_888 {
s = "hello, world!" + "hello, world!";
}
"#;
Expand All @@ -159,7 +159,7 @@ fn bench_eval_loop_strings_build(bench: &mut Bencher) {
fn bench_eval_loop_strings_no_build(bench: &mut Bencher) {
let script = r#"
let s;
for x in 0..10000 {
for x in 0..1_888 {
s = "hello" + "";
}
"#;
Expand Down
8 changes: 0 additions & 8 deletions codegen/src/test/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ mod module_tests {
assert!(item_mod.consts().is_empty());
assert_eq!(item_mod.sub_modules().len(), 1);
assert_eq!(&item_mod.sub_modules()[0].consts()[0].name, "MYSTIC_NUMBER");
assert_eq!(
item_mod.sub_modules()[0].consts()[0].expr,
syn::parse2::<syn::Expr>(quote! { 42 }).unwrap()
);
}

#[test]
Expand Down Expand Up @@ -244,10 +240,6 @@ mod module_tests {
assert!(item_mod.fns().is_empty());
assert_eq!(item_mod.consts().len(), 1);
assert_eq!(&item_mod.consts()[0].name, "MYSTIC_NUMBER");
assert_eq!(
item_mod.consts()[0].expr,
syn::parse2::<syn::Expr>(quote! { 42 }).unwrap()
);
}

#[test]
Expand Down

0 comments on commit da1b662

Please sign in to comment.