MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / canonical_values_roundtrip

Function canonical_values_roundtrip

atomic-core/src/change/attribute.rs:151–164  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149
150 #[test]
151 fn canonical_values_roundtrip() {
152 for value in [
153 InodeAttr::Mode(0o755),
154 InodeAttr::Kind(InodeKind::Regular),
155 InodeAttr::Kind(InodeKind::Symlink),
156 InodeAttr::Kind(InodeKind::Gitlink),
157 ] {
158 let (len, bytes) = value.canonical_bytes().unwrap();
159 assert_eq!(
160 InodeAttr::from_canonical(value.name(), &bytes[..usize::from(len)]).unwrap(),
161 value
162 );
163 }
164 }
165
166 #[test]
167 fn malformed_values_are_rejected() {

Callers

nothing calls this directly

Calls 4

ModeEnum · 0.85
KindEnum · 0.85
unwrapMethod · 0.45
canonical_bytesMethod · 0.45

Tested by

no test coverage detected