()
| 76 | |
| 77 | #[test] |
| 78 | fn test_save_and_load_selective() -> Result<()> { |
| 79 | let test_dir = setup_test_dir(); |
| 80 | |
| 81 | let prefs = PreferenceConfig::new(test_dir.clone())?; |
| 82 | |
| 83 | // Create test data |
| 84 | let test_data = TestConfig { |
| 85 | string_value: "test".to_string(), |
| 86 | number_value: 42, |
| 87 | boolean_value: true, |
| 88 | }; |
| 89 | |
| 90 | // Save data |
| 91 | prefs.save_selective("test_key".to_string(), Some(test_data.clone()))?; |
| 92 | |
| 93 | // Load data |
| 94 | let loaded_data: TestConfig = prefs.load_selective("test_key".to_string())?; |
| 95 | |
| 96 | // Verify data |
| 97 | assert_eq!( |
| 98 | loaded_data, test_data, |
| 99 | "Loaded data should match saved data" |
| 100 | ); |
| 101 | |
| 102 | cleanup_test_dir(test_dir); |
| 103 | Ok(()) |
| 104 | } |
| 105 | |
| 106 | #[test] |
| 107 | fn test_save_and_load_array() -> Result<()> { |
nothing calls this directly
no test coverage detected