Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit 74021c5

Browse files
committed
Fix types declaration in tests.
Fixes #92.
1 parent 8b5f4fa commit 74021c5

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

tests/tests.rs

+23-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ extern crate error_chain;
1010
fn smoke_test_1() {
1111
error_chain! {
1212
types {
13-
Error, ErrorKind, Result;
13+
Error, ErrorKind, ResultExt, Result;
1414
}
1515

1616
links { }
@@ -175,7 +175,7 @@ fn order_test_7() {
175175
foreign_links { }
176176

177177
types {
178-
Error, ErrorKind, Result;
178+
Error, ErrorKind, ResultExt, Result;
179179
}
180180
};
181181
}
@@ -190,7 +190,7 @@ fn order_test_8() {
190190
foreign_links { }
191191

192192
types {
193-
Error, ErrorKind, Result;
193+
Error, ErrorKind, ResultExt, Result;
194194
}
195195
};
196196
}
@@ -377,7 +377,7 @@ mod attributes_test {
377377

378378
error_chain! {
379379
types {
380-
Error, ErrorKind, Result;
380+
Error, ErrorKind, ResultExt, Result;
381381
}
382382

383383
links {
@@ -441,7 +441,7 @@ fn documentation() {
441441
mod multiple_error_same_mod {
442442
error_chain! {
443443
types {
444-
MyError, MyErrorKind, MyResult;
444+
MyError, MyErrorKind, MyResultExt, MyResult;
445445
}
446446
}
447447
error_chain! {}
@@ -523,3 +523,21 @@ fn bail() {
523523
bail!("{}", "baz")
524524
}
525525
}
526+
527+
/// Since the `types` declaration is a list of symbols, check if we
528+
/// don't change their meaning or order.
529+
#[test]
530+
fn types_declarations() {
531+
error_chain! {
532+
types {
533+
MyError, MyErrorKind, MyResultExt, MyResult;
534+
}
535+
}
536+
537+
MyError::from_kind(MyErrorKind::Msg("".into()));
538+
539+
let err: Result<(), ::std::io::Error> = Ok(());
540+
MyResultExt::chain_err(err, || "").unwrap();
541+
542+
let _: MyResult<()> = Ok(());
543+
}

0 commit comments

Comments
 (0)