diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-01-30 21:00:57 -0800 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-01-31 10:08:24 -0800 |
| commit | fba35e1a3c87892823d1f4d436b9f00a7864cf16 (patch) | |
| tree | 1fadaaee99ef266bd2f709fb2aa5577184ab611e /src/libstd/test.rs | |
| parent | 813a55d89135efb716dd80e96453a091a7cfc631 (diff) | |
| download | rust-fba35e1a3c87892823d1f4d436b9f00a7864cf16.tar.gz rust-fba35e1a3c87892823d1f4d436b9f00a7864cf16.zip | |
Require alts to be exhaustive
middle::check_alt does the work. Lots of changes to add default cases into alts that were previously inexhaustive.
Diffstat (limited to 'src/libstd/test.rs')
| -rw-r--r-- | src/libstd/test.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstd/test.rs b/src/libstd/test.rs index 707e4cf153f..10b3545fc40 100644 --- a/src/libstd/test.rs +++ b/src/libstd/test.rs @@ -398,7 +398,8 @@ mod tests { fn first_free_arg_should_be_a_filter() { let args = ["progname", "filter"]; check (vec::is_not_empty(args)); - let opts = alt parse_opts(args) { either::left(o) { o } }; + let opts = alt parse_opts(args) { either::left(o) { o } + _ { fail "Malformed arg in first_free_arg_should_be_a_filter"; } }; assert (str::eq("filter", option::get(opts.filter))); } @@ -406,7 +407,8 @@ mod tests { fn parse_ignored_flag() { let args = ["progname", "filter", "--ignored"]; check (vec::is_not_empty(args)); - let opts = alt parse_opts(args) { either::left(o) { o } }; + let opts = alt parse_opts(args) { either::left(o) { o } + _ { fail "Malformed arg in parse_ignored_flag"; } }; assert (opts.run_ignored); } |
