MCPcopy Create free account
hub / github.com/ankddev/envfetch / test_set_variable_global

Function test_set_variable_global

src/variables.rs:150–162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

148
149 #[test]
150 fn test_set_variable_global() {
151 let result = set_variable("TEST_GLOBAL_VAR", "test_value", true);
152 match result {
153 Ok(_) => {
154 assert_eq!(env::var("TEST_GLOBAL_VAR").unwrap(), "test_value");
155 delete_variable("TEST_GLOBAL_VAR".to_string(), true).unwrap();
156 }
157 Err(ErrorKind::CannotSetVariableGlobally(_)) => {
158 // Test passes if we get permission error on non-admin run
159 }
160 Err(e) => panic!("Unexpected error: {:?}", e),
161 }
162 }
163
164 #[test]
165 fn test_delete_variable_global() {

Callers

nothing calls this directly

Calls 2

set_variableFunction · 0.85
delete_variableFunction · 0.85

Tested by

no test coverage detected