From ea97fa3394325342f73cd27a1bfee06376968234 Mon Sep 17 00:00:00 2001 From: Grace Chin Date: Wed, 24 Jun 2020 18:40:18 +0000 Subject: [PATCH] Add tests for correct and incorrect feature argument number inputs --- src/lineardev.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/lineardev.rs b/src/lineardev.rs index 0ec1961c0..ca2df2e57 100644 --- a/src/lineardev.rs +++ b/src/lineardev.rs @@ -934,6 +934,28 @@ mod tests { assert_eq!(result.feature_args, expected); } + #[test] + fn test_flakey_correct_feature_args_input() { + let result = "flakey 8:32 0 16 2 2 error_writes drop_writes" + .parse::() + .unwrap(); + let expected = [FeatureArg::ErrorWrites, FeatureArg::DropWrites] + .iter() + .cloned() + .collect::>(); + assert_eq!(result.feature_args, expected); + } + + #[test] + #[should_panic] + fn test_flakey_incorrect_feature_args_input() { + let result = "flakey 8:32 0 16 2 3 error_writes drop_writes" + .parse::() + .unwrap(); + let expected = vec![].iter().cloned().collect::>(); + assert_eq!(result.feature_args, expected); + } + #[test] fn loop_test_duplicate_segments() { test_with_spec(1, test_duplicate_segments);