MCPcopy Create free account
hub / github.com/Moosync/Moosync / test_remove_preference

Function test_remove_preference

src-tauri/preferences/src/test.rs:309–328  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

307
308#[test]
309fn test_remove_preference() -> Result<()> {
310 let test_dir = setup_test_dir();
311
312 let prefs = PreferenceConfig::new(test_dir.clone())?;
313
314 // Save test data
315 prefs.save_selective("remove_key".to_string(), Some("test_value"))?;
316
317 // Verify key exists
318 assert!(prefs.has_key("remove_key"), "Key should exist initially");
319
320 // Remove the key
321 prefs.save_selective::<String>("remove_key".to_string(), None)?;
322
323 // Verify key no longer exists
324 assert!(!prefs.has_key("remove_key"), "Key should be removed");
325
326 cleanup_test_dir(test_dir);
327 Ok(())
328}

Callers

nothing calls this directly

Calls 4

setup_test_dirFunction · 0.85
cleanup_test_dirFunction · 0.85
cloneMethod · 0.80
save_selectiveMethod · 0.80

Tested by

no test coverage detected