rhai/tests
Geoffroy Couprie f2b5566c0b use smartstring's deserializer to support non borrowed strings
The map visitor for Dynamic was expecting a &str for the key, but the
serde_json deserializer internally uses a Cow string, which can be
Borrowed or Owned. In the case of Owned, the serde_json key deserializer
is calling visit_string on the Visitor, which for &str will result in
the error:
Error("invalid type: string \"a\", expected a borrowed string", line: 0,
column: 0)

smartstring actually has its own Visitor implementation that handles
both cases, so we can use it instead of an explicit conversion.
2022-05-23 16:40:49 +02:00
..
arrays.rs Add tests for index type checks. 2022-05-17 15:20:32 +08:00
assignments.rs
binary_ops.rs
bit_fields.rs Fix test for only_i32. 2022-01-14 23:19:27 +08:00
blobs.rs Minor refactor. 2022-03-09 09:25:55 +08:00
bool_op.rs Catch more parse errors. 2021-07-04 00:15:27 +08:00
call_fn.rs Simplify using .. 2022-02-08 09:02:15 +08:00
chars.rs
closures.rs Use .. for (_). 2022-02-08 09:46:14 +08:00
comments.rs Change eval<()> to run. 2022-01-10 13:26:33 +08:00
compound_equality.rs
constants.rs Simplify using .. 2022-02-08 09:02:15 +08:00
custom_syntax.rs Simplify using .. 2022-02-08 09:02:15 +08:00
data_size.rs Simplify using .. 2022-02-08 09:02:15 +08:00
debugging.rs Allow initialization of EvalState tag and separate debugger state into separate variable. 2022-05-21 21:44:12 +08:00
decrement.rs
eval.rs Simplify using .. 2022-02-08 09:02:15 +08:00
expressions.rs Reduce usage of Default::default() to make it easier to refactor. 2021-11-07 18:12:37 +08:00
float.rs
fn_ptr.rs Use .. for (_). 2022-02-08 09:46:14 +08:00
for.rs Fix builds. 2021-12-31 18:55:48 +08:00
functions.rs Simplify using .. 2022-02-08 09:02:15 +08:00
get_set.rs Add EvalAltResult::IndexNotFound. 2022-05-19 10:02:12 +08:00
if_block.rs
increment.rs
internal_fn.rs Use .. for (_). 2022-02-08 09:46:14 +08:00
looping.rs
maps.rs Fix test. 2022-05-19 16:56:22 +08:00
math.rs Simplify using .. 2022-02-08 09:02:15 +08:00
method_call.rs Fix bug with eager optimization of method calls. 2022-03-04 12:22:44 +08:00
mismatched_op.rs Simplify using .. 2022-02-08 09:02:15 +08:00
modules.rs Fix tests. 2022-05-21 11:57:23 +08:00
native.rs Remove volatile warnings for types and functions exposed unter internals. 2021-11-28 22:03:02 +08:00
not.rs
number_literals.rs Fix bug in hex parsing for negative numbers. 2021-12-18 17:07:30 +08:00
operations.rs Use .. for (_). 2022-02-08 09:46:14 +08:00
ops.rs Simplify using .. 2022-02-08 09:02:15 +08:00
optimizer.rs Use global module constants in optimization. 2022-03-28 12:53:52 +08:00
options.rs Allow variables in scope for strict vars. 2022-04-22 12:12:36 +08:00
packages.rs
plugins_register.rs
plugins_unroll.rs Refactor wasm feature gates. 2022-01-04 22:16:20 +08:00
plugins.rs Search for global variables in global modules. 2022-03-27 21:49:34 +08:00
power_of.rs
print.rs Change Engine::consume_XXX to Engine::run_XXX. 2021-08-17 15:50:56 +08:00
README.md
serde.rs use smartstring's deserializer to support non borrowed strings 2022-05-23 16:40:49 +02:00
side_effects.rs Change Engine::consume_XXX to Engine::run_XXX. 2021-08-17 15:50:56 +08:00
stack.rs Use .. for (_). 2022-02-08 09:46:14 +08:00
string.rs Simplify using .. 2022-02-08 09:02:15 +08:00
switch.rs Change eval<()> to run. 2022-01-10 13:26:33 +08:00
throw.rs Simplify using .. 2022-02-08 09:02:15 +08:00
time.rs Use target_family for wasm. 2022-01-12 08:12:28 +08:00
tokens.rs Allow non-custom reserved symbols in custom syntax. 2021-12-16 18:01:49 +08:00
types.rs
unary_after_binary.rs
unary_minus.rs
unit.rs Add Token::Unit. 2022-04-21 10:04:46 +08:00
var_scope.rs Minor cleanup. 2022-05-02 12:14:53 +08:00
while_loop.rs Change Engine::consume_XXX to Engine::run_XXX. 2021-08-17 15:50:56 +08:00

Tests

Rhai engine tests.

How to Run

cargo test