MCPcopy Create free account
hub / github.com/apache/fory / test_encode_empty_string

Function test_encode_empty_string

rust/tests/tests/test_meta_string.rs:124–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122
123#[test]
124fn test_encode_empty_string() {
125 let encoder = &TYPE_NAME_ENCODER;
126 let decoder = &TYPE_NAME_DECODER;
127 for encoding in [
128 Encoding::LowerSpecial,
129 Encoding::LowerUpperDigitSpecial,
130 Encoding::FirstToLowerSpecial,
131 Encoding::AllToLowerSpecial,
132 Encoding::Utf8,
133 ] {
134 let meta_string = encoder.encode_with_encoding("", encoding).unwrap();
135 assert_eq!(meta_string.bytes.len(), 0);
136 let decoded = decoder
137 .decode(&meta_string.bytes, meta_string.encoding)
138 .unwrap();
139 assert_eq!(decoded, meta_string);
140 }
141}
142
143#[test]
144fn test_encode_characters_outside_of_lower_special() {

Callers

nothing calls this directly

Calls 3

decodeMethod · 0.65
unwrapMethod · 0.45
encode_with_encodingMethod · 0.45

Tested by

no test coverage detected