Unified · Split
| @@ -50,10 +50,15 @@ impl Tag { · 49 unmodified lines | ||
| 50 | 50 | ser::trusted_header_field(b"type", self.target_kind.to_bytes(), &mut out)?; |
| 51 | 51 | ser::header_field(b"tag", validated_name(self.name.as_ref())?, &mut out)?; |
| 52 | 52 | ser::trusted_header_field_signature(b"tagger", &self.signature, &mut out)?; |
| 53 | + | |
| 53 | 54 | if !self.message.is_empty() { |
| 54 | 55 | out.write_all(NL)?; |
| 55 | 56 | out.write_all(&self.message)?; |
| 56 | 57 | } |
| 58 | + if let Some(ref message) = self.pgp_signature { | |
| 59 | + out.write_all(NL)?; | |
| 60 | + out.write_all(&message)?; | |
| 61 | + } | |
| 57 | 62 | Ok(()) |
| 58 | 63 | } |
| 59 | 64 | } |
| @@ -118,7 +118,12 @@ mod tag { · 117 unmodified lines | ||
| 118 | 118 | |
| 119 | 119 | #[test] |
| 120 | 120 | fn round_trip() { |
| 121 | − for input in &["tag/empty.txt", "tag/whitespace.txt"] { | |
| 121 | + for input in &[ | |
| 122 | + "tag/empty.txt", | |
| 123 | + "tag/whitespace.txt", | |
| 124 | + "tag/with-newlines.txt", | |
| 125 | + "tag/signed.txt", | |
| 126 | + ] { | |
| 122 | 127 | let input = fixture_bytes(input); |
| 123 | 128 | let tag: owned::Tag = borrowed::Tag::from_bytes(&input).unwrap().into(); |
| 124 | 129 | let mut output = Vec::new(); |