From 9fec284855d2d32f5b929c6166a234236d7a2203 Mon Sep 17 00:00:00 2001 From: TheVeryDarkness <3266343194@qq.com> Date: Mon, 14 Oct 2024 16:18:33 +0800 Subject: [PATCH] Update tests about `read!`. --- examples/doc_macro_read.rs | 9 +++++++++ examples/doc_macro_read.txt | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/examples/doc_macro_read.rs b/examples/doc_macro_read.rs index 9abb0e5..6912324 100644 --- a/examples/doc_macro_read.rs +++ b/examples/doc_macro_read.rs @@ -18,4 +18,13 @@ fn main() { [[19, 20, 21], [22, 23, 24], [25, 26, 27],], ], ); + + let v: Vec = read!(3; fmt = iof::fmt::CSV); + assert_eq!(v, [1, 2, 3]); + + let v: Vec = read!(3; skip = ";\r\n".chars()); + assert_eq!(v, [1, 2, 3]); + + let v: Vec = read!(3; skip = [':', '\r', '\n']); + assert_eq!(v, [1, 2, 3]); } diff --git a/examples/doc_macro_read.txt b/examples/doc_macro_read.txt index a39704d..20bbd1c 100644 --- a/examples/doc_macro_read.txt +++ b/examples/doc_macro_read.txt @@ -13,3 +13,7 @@ 19 20 21 22 23 24 25 26 27 + +1,2,3 +1;2;3 +1:2:3