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

Function test_preference_init

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

Source from the content-addressed store, hash-verified

51
52#[test]
53fn test_preference_init() -> Result<()> {
54 let test_dir = setup_test_dir();
55
56 let prefs = PreferenceConfig::new(test_dir.clone())?;
57
58 // Verify the config file exists
59 let config_file = prefs.config_file.lock().unwrap();
60 assert!(
61 config_file.exists(),
62 "Config file should be created during initialization"
63 );
64
65 // Verify memcache is initialized as an object
66 // Note: The memcache might not be empty as it could contain default values
67 let memcache = prefs.memcache.lock().unwrap();
68 assert!(
69 memcache.is_object(),
70 "Memcache should be initialized as an object"
71 );
72
73 cleanup_test_dir(test_dir);
74 Ok(())
75}
76
77#[test]
78fn test_save_and_load_selective() -> Result<()> {

Callers

nothing calls this directly

Calls 3

setup_test_dirFunction · 0.85
cleanup_test_dirFunction · 0.85
cloneMethod · 0.80

Tested by

no test coverage detected