Loading crates/s3s/src/dto/timestamp.rs +5 −2 Original line number Diff line number Diff line Loading @@ -60,6 +60,9 @@ pub enum FormatTimestampError { const RFC1123: &[FormatItem<'_>] = format_description!("[weekday repr:short], [day] [month repr:short] [year] [hour]:[minute]:[second] GMT"); /// See <https://github.com/minio/minio-java/issues/1419> const RFC3339: &[FormatItem<'_>] = format_description!("[year]-[month]-[day]T[hour]:[minute]:[second].[subsecond digits:3]Z"); impl Timestamp { pub fn parse(format: TimestampFormat, s: &str) -> Result<Self, ParseTimestampError> { let ans = match format { Loading Loading @@ -96,7 +99,7 @@ impl Timestamp { pub fn format(&self, format: TimestampFormat, w: &mut impl io::Write) -> Result<(), FormatTimestampError> { match format { TimestampFormat::DateTime => { self.0.format_into(w, &Rfc3339)?; self.0.format_into(w, RFC3339)?; } TimestampFormat::HttpDate => { self.0.format_into(w, RFC1123)?; Loading @@ -120,7 +123,7 @@ mod tests { #[test] fn text_repr() { let cases = [ (TimestampFormat::DateTime, "1985-04-12T23:20:50.52Z"), (TimestampFormat::DateTime, "1985-04-12T23:20:50.520Z"), (TimestampFormat::HttpDate, "Tue, 29 Apr 2014 18:30:38 GMT"), (TimestampFormat::HttpDate, "Wed, 21 Oct 2015 07:28:00 GMT"), // (TimestampFormat::HttpDate, "Sun, 02 Jan 2000 20:34:56.000 GMT"), // FIXME: optional fractional seconds Loading scripts/report-mint.py +13 −2 Original line number Diff line number Diff line Loading @@ -61,8 +61,19 @@ if __name__ == "__main__": name = "summary" print(f"{name:<20} passed {total_pass_count:>3}, failed {total_fail_count:>3}, na {total_na_count:>3}") # TODO: pass more tests assert counts["s3cmd"]["fail"] == 0 assert counts["aws-sdk-go"]["fail"] == 0 assert counts["aws-sdk-ruby"]["fail"] == 0 assert counts["mc"]["fail"] == 0 assert counts["s3cmd"]["fail"] == 0 # FIXME: E2E tests assert counts["aws-sdk-php"]["pass"] >= 12 assert counts["awscli"]["pass"] >= 10 assert counts["minio-dotnet"]["pass"] >= 1 assert counts["minio-go"]["pass"] >= 1 assert counts["minio-java"]["pass"] >= 8 assert counts["minio-py"]["pass"] >= 12 assert counts["versioning"]["pass"] >= 4 # assert counts["minio-js"]["pass"] >= 0 # assert counts["s3select"]["pass"] >= 0 Loading
crates/s3s/src/dto/timestamp.rs +5 −2 Original line number Diff line number Diff line Loading @@ -60,6 +60,9 @@ pub enum FormatTimestampError { const RFC1123: &[FormatItem<'_>] = format_description!("[weekday repr:short], [day] [month repr:short] [year] [hour]:[minute]:[second] GMT"); /// See <https://github.com/minio/minio-java/issues/1419> const RFC3339: &[FormatItem<'_>] = format_description!("[year]-[month]-[day]T[hour]:[minute]:[second].[subsecond digits:3]Z"); impl Timestamp { pub fn parse(format: TimestampFormat, s: &str) -> Result<Self, ParseTimestampError> { let ans = match format { Loading Loading @@ -96,7 +99,7 @@ impl Timestamp { pub fn format(&self, format: TimestampFormat, w: &mut impl io::Write) -> Result<(), FormatTimestampError> { match format { TimestampFormat::DateTime => { self.0.format_into(w, &Rfc3339)?; self.0.format_into(w, RFC3339)?; } TimestampFormat::HttpDate => { self.0.format_into(w, RFC1123)?; Loading @@ -120,7 +123,7 @@ mod tests { #[test] fn text_repr() { let cases = [ (TimestampFormat::DateTime, "1985-04-12T23:20:50.52Z"), (TimestampFormat::DateTime, "1985-04-12T23:20:50.520Z"), (TimestampFormat::HttpDate, "Tue, 29 Apr 2014 18:30:38 GMT"), (TimestampFormat::HttpDate, "Wed, 21 Oct 2015 07:28:00 GMT"), // (TimestampFormat::HttpDate, "Sun, 02 Jan 2000 20:34:56.000 GMT"), // FIXME: optional fractional seconds Loading
scripts/report-mint.py +13 −2 Original line number Diff line number Diff line Loading @@ -61,8 +61,19 @@ if __name__ == "__main__": name = "summary" print(f"{name:<20} passed {total_pass_count:>3}, failed {total_fail_count:>3}, na {total_na_count:>3}") # TODO: pass more tests assert counts["s3cmd"]["fail"] == 0 assert counts["aws-sdk-go"]["fail"] == 0 assert counts["aws-sdk-ruby"]["fail"] == 0 assert counts["mc"]["fail"] == 0 assert counts["s3cmd"]["fail"] == 0 # FIXME: E2E tests assert counts["aws-sdk-php"]["pass"] >= 12 assert counts["awscli"]["pass"] >= 10 assert counts["minio-dotnet"]["pass"] >= 1 assert counts["minio-go"]["pass"] >= 1 assert counts["minio-java"]["pass"] >= 8 assert counts["minio-py"]["pass"] >= 12 assert counts["versioning"]["pass"] >= 4 # assert counts["minio-js"]["pass"] >= 0 # assert counts["s3select"]["pass"] >= 0