Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
file in snapbox - Rust
[go: Go Back, main page]

Macro snapbox::file

source ·
macro_rules! file {
    [_] => { ... };
    [_ : $type:ident] => { ... };
    [$path:literal] => { ... };
    [$path:literal : $type:ident] => { ... };
}
Expand description

Declare an expected value for an assert from a file

This is relative to the source file the macro is run from

file!["./test_data/bar.json"];
file!["./test_data/bar.json": Text];  // do textual rather than structural comparisons
file![_];
file![_: Json];  // ensure its treated as json since a type can't be inferred