Repository: alex/rust-asn1 (language: rust)

Issue:
Get coverage (closer) to 100%
- [x] add ratchet to CI to ensure coverage doesn't regress
- [ ] `src/`
  - [x] `base128.rs`
  - [x] `bit_string.rs`
  - [x] `lib.rs`
  - [x] `object_identifier.rs`
  - [x] `parser.rs`
  - [x] `tag.rs`
  - [ ] `types.rs`
  - [x] `writer.rs`


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 100cfe9..5d88bce 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -159,6 +159,6 @@ jobs:
           with open("output.log") as f:
               [line] = [l for l in f if l.startswith("  lines......:")]
           coverage = float(re.search("([\d\.]+)%", line).group(1))
-          if coverage < 99.9:
+          if coverage < 100:
               raise ValueError(f"Coverage too low: {coverage}")
         shell: python
diff --git a/src/parser.rs b/src/parser.rs
index ae5d6c2..bf39192 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -1047,6 +1047,10 @@ mod tests {
                 .unwrap()),
                 b"\x17\x11910506164540+0730",
             ),
+            (
+                Ok(UtcTime::new(Utc.ymd(1951, 5, 6).and_hms(23, 45, 0)).unwrap()),
+                b"\x17\x0f5105062345+0000",
+            ),
             (
                 Ok(UtcTime::new(Utc.ymd(1991, 5, 6).and_hms(23, 45, 40)).unwrap()),
                 b"\x17\x0d910506234540Z",
diff --git a/src/types.rs b/src/types.rs
index c95336b..71ec46d 100644
--- a/src/types.rs
+++ b/src/types.rs
@@ -1386,8 +1386,8 @@ impl<'a, T: Asn1Writable<'a>, const TAG: u32> SimpleAsn1Writable<'a> for Explici
 mod tests {
     use crate::{
         parse_single, BigInt, BigUint, Enumerated, GeneralizedTime, IA5String, ParseError,
-        ParseErrorKind, PrintableString, SequenceOf, SetOf, Tag, Tlv, UtcTime, Utf8String,
-        VisibleString,
+        ParseErrorKind, PrintableString, SequenceOf, SequenceOfWriter, SetOf, SetOfWriter, Tag,
+        Tlv, UtcTime, Utf8String, VisibleString,
     };
     #[cfg(feature = "const-generics")]
     use crate::{Explicit, Implicit};
@@ -1548,6 +1548,21 @@ mod tests {
         assert_ne!(hash(&s3), hash(&s4));
     }
 
+    #[test]
+    fn test_sequence_of_writer_clone() {
+        let s1 = SequenceOfWriter::new([1, 2, 3]);
+        let s2 = s1.clone();
+
+        assert!(s1 == s2);
+    }
+
+    #[test]
+    fn test_set_of_writer_clone() {
+        let s1 = SetOfWriter::new([1, 2, 3]);
+        let s2 = s1.clone();
+
+        assert!(s1 == s2);
+    }
     #[test]
     fn test_utctime_new() {
         assert!(UtcTime::new(chrono::Utc.ymd(1950, 1, 1).and_hms(12, 0, 0)).is_some());


Test patch: