MCPcopy Create free account
hub / github.com/FeatureProbe/server-sdk-rust / test_select_variation_fail

Function test_select_variation_fail

src/evaluate.rs:936–965  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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(&params).expect_err("e");
963
964 assert!(format!("{:?}", result).contains("does not have attribute"));
965 }
966}
967
968#[cfg(test)]

Callers

nothing calls this directly

Calls 1

select_variationMethod · 0.80

Tested by

no test coverage detected