Open max-sixty opened 1 month ago
I did some more testing. There are some corner-cases where it doesn't work; for example if info is used it fails, because our serializer / deserializer doesn't roundtrip.
info
For example; from the insta tests, One is Map; the other a Struct:
Map
Struct
[insta/src/snapshot.rs:440:20] self.metadata.trim_for_persistence() = MetaData { source: None, assertion_line: None, description: Some( "The snapshot is four integers", ), expression: None, info: Some( Map( [ ( String( "env", ), Map( [ ( String( "ENVIRONMENT", ), String( "production", ), ), ], ), ), ( String( "cmdline", ), Seq( [ String( "my-tool", ), String( "run", ), ], ), ), ], ), ), input_file: None, } [insta/src/snapshot.rs:441:24] other.metadata.trim_for_persistence() = MetaData { source: None, assertion_line: None, description: Some( "The snapshot is four integers", ), expression: None, info: Some( Struct( "Info", [ ( "env", Map( [ ( String( "ENVIRONMENT", ), String( "production", ), ), ], ), ), ( "cmdline", Seq( [ String( "my-tool", ), String( "run", ), ], ), ), ], ), ), input_file: None, }
I did some more testing. There are some corner-cases where it doesn't work; for example if
info
is used it fails, because our serializer / deserializer doesn't roundtrip.For example; from the insta tests, One is
Map
; the other aStruct
: