mirror of
https://github.com/haraldh/chainerror.git
synced 2025-02-21 16:14:44 +01:00
test: rewrite doc test
Line numbering has changed in Rust 1.71 in the doc tests, due to an extra inserted `#[allow(unused_extern_crates)]` line. Don't test for the exact line number anymore. Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
This commit is contained in:
parent
376e133836
commit
95c5a02d50
19
src/lib.rs
19
src/lib.rs
|
@ -60,17 +60,16 @@
|
||||||
//! fn main() {
|
//! fn main() {
|
||||||
//! if let Err(e) = process_config_file() {
|
//! if let Err(e) = process_config_file() {
|
||||||
//! eprintln!("Error:\n{:?}", e);
|
//! eprintln!("Error:\n{:?}", e);
|
||||||
//! # assert_eq!(
|
//! # let s = format!("{:?}", e);
|
||||||
//! # format!("{:?}\n", e),
|
//! # let lines = s.lines().collect::<Vec<_>>();
|
||||||
//! # "\
|
//! # assert_eq!(lines.len(), 5);
|
||||||
//! # src/lib.rs:16:51: read the config file\n\
|
//! # assert!(lines[0].starts_with("src/lib.rs:"));
|
||||||
//! # Caused by:\n\
|
//! # assert_eq!(lines[1], "Caused by:");
|
||||||
//! # src/lib.rs:9:47: Reading file: \"foo.txt\"\n\
|
//! # assert!(lines[2].starts_with("src/lib.rs:"));
|
||||||
//! # Caused by:\n\
|
//! # assert_eq!(lines[3], "Caused by:");
|
||||||
//! # Os { code: 2, kind: NotFound, message: \"No such file or directory\" }\n\
|
//! # assert_eq!(lines[4], "Os { code: 2, kind: NotFound, message: \"No such file or directory\" }");
|
||||||
//! # ",
|
|
||||||
//! # );
|
|
||||||
//! }
|
//! }
|
||||||
|
//! # else { panic!(); }
|
||||||
//! }
|
//! }
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
|
|
Loading…
Reference in a new issue