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

Function test_match_equal_string

src/evaluate.rs:1300–1314  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1298
1299 #[test]
1300 fn test_match_equal_string() {
1301 let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
1302 path.push("resources/fixtures/repo.json");
1303 let json_str = fs::read_to_string(path).unwrap();
1304 let repo = load_json(&json_str);
1305 assert!(repo.is_ok());
1306 let repo = repo.unwrap();
1307
1308 let user = FPUser::new().with("city", "1");
1309 let toggle = repo.toggles.get("json_toggle").unwrap();
1310 let r = toggle.eval(&user, &repo.segments, &repo.toggles, false, MAX_DEEP, None);
1311 let r = r.value.unwrap();
1312 let r = r.as_object().unwrap();
1313 assert!(r.get("variation_0").is_some());
1314 }
1315
1316 #[test]
1317 fn test_segment_deserialize() {

Callers

nothing calls this directly

Calls 4

load_jsonFunction · 0.85
withMethod · 0.80
getMethod · 0.80
evalMethod · 0.45

Tested by

no test coverage detected