Skip to content

Commit

Permalink
Update tests about read!.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheVeryDarkness committed Oct 14, 2024
1 parent 1bf8adf commit 9fec284
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/doc_macro_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,13 @@ fn main() {
[[19, 20, 21], [22, 23, 24], [25, 26, 27],],
],
);

let v: Vec<i32> = read!(3; fmt = iof::fmt::CSV);
assert_eq!(v, [1, 2, 3]);

let v: Vec<i32> = read!(3; skip = ";\r\n".chars());
assert_eq!(v, [1, 2, 3]);

let v: Vec<i32> = read!(3; skip = [':', '\r', '\n']);
assert_eq!(v, [1, 2, 3]);
}
4 changes: 4 additions & 0 deletions examples/doc_macro_read.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
19 20 21
22 23 24
25 26 27

1,2,3
1;2;3
1:2:3

0 comments on commit 9fec284

Please sign in to comment.