Skip to main content

test_record

Macro test_record 

Source
macro_rules! test_record {
    {$($col:expr => $val:expr),+ $(,)?} => { ... };
    {} => { ... };
}
Expand description

Helper for constructing Value::Record instances for use in tests and Examples

let test = test_record! {
    "a" => "foo",
    "b" => 42,
    "c" => [1, 2, 3],
};

let expected = Value::test_record(record! {
    "a" => Value::test_string("foo"),
    "b" => Value::test_int(42),
    "c" => Value::test_list(vec![
        Value::test_int(1),
        Value::test_int(2),
        Value::test_int(3),
    ]),
});

assert_eq!(test, expected);