Function inflector::string::deconstantize::deconstantize
source · [−]Expand description
Deconstantizes a &str
use inflector::string::deconstantize::deconstantize;
let mock_string: &str = "Bar";
let expected_string: String = "".to_owned();
let asserted_string: String = deconstantize(mock_string);
assert!(asserted_string == expected_string);
use inflector::string::deconstantize::deconstantize;
let mock_string: &str = "::Bar";
let expected_string: String = "".to_owned();
let asserted_string: String = deconstantize(mock_string);
assert!(asserted_string == expected_string);
use inflector::string::deconstantize::deconstantize;
let mock_string: &str = "Foo::Bar";
let expected_string: String = "Foo".to_owned();
let asserted_string: String = deconstantize(mock_string);
assert!(asserted_string == expected_string);
use inflector::string::deconstantize::deconstantize;
let mock_string: &str = "Test::Foo::Bar";
let expected_string: String = "Foo".to_owned();
let asserted_string: String = deconstantize(mock_string);
assert!(asserted_string == expected_string);