()
| 934 | |
| 935 | #[test] |
| 936 | fn test_select_variation_fail() { |
| 937 | let distribution = Distribution { |
| 938 | distribution: vec![ |
| 939 | vec![BucketRange((0, 5000))], |
| 940 | vec![BucketRange((5000, 10000))], |
| 941 | ], |
| 942 | bucket_by: Some("name".to_string()), |
| 943 | salt: Some("salt".to_string()), |
| 944 | }; |
| 945 | let serve = Serve::Split(distribution); |
| 946 | |
| 947 | let user_with_no_name = FPUser::new(); |
| 948 | |
| 949 | let params = EvalParams { |
| 950 | key: "", |
| 951 | is_detail: true, |
| 952 | user: &user_with_no_name, |
| 953 | variations: &[ |
| 954 | Value::String("a".to_string()), |
| 955 | Value::String("b".to_string()), |
| 956 | ], |
| 957 | segment_repo: &Default::default(), |
| 958 | toggle_repo: &Default::default(), |
| 959 | debug_until_time: None, |
| 960 | }; |
| 961 | |
| 962 | let result = serve.select_variation(¶ms).expect_err("e"); |
| 963 | |
| 964 | assert!(format!("{:?}", result).contains("does not have attribute")); |
| 965 | } |
| 966 | } |
| 967 | |
| 968 | #[cfg(test)] |
nothing calls this directly
no test coverage detected