Removes chrono for time

Reduces the number of dependencies
pull/174/head
Tpt 3 years ago
parent 44d1a5f04c
commit 05d7370a69
  1. 39
      Cargo.lock
  2. 1
      README.md
  3. 2
      testsuite/Cargo.toml
  4. 4
      testsuite/src/evaluator.rs
  5. 9
      testsuite/src/report.rs

39
Cargo.lock generated

@ -149,19 +149,6 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
version = "0.4.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
dependencies = [
"libc",
"num-integer",
"num-traits",
"time",
"winapi 0.3.9",
]
[[package]]
name = "clang-sys"
version = "1.3.0"
@ -689,16 +676,6 @@ dependencies = [
"version_check",
]
[[package]]
name = "num-integer"
version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
dependencies = [
"autocfg",
"num-traits",
]
[[package]]
name = "num-traits"
version = "0.2.14"
@ -845,11 +822,11 @@ name = "oxigraph_testsuite"
version = "0.3.0-dev"
dependencies = [
"anyhow",
"chrono",
"clap",
"criterion",
"oxigraph",
"text-diff",
"time",
]
[[package]]
@ -1368,9 +1345,9 @@ checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012"
[[package]]
name = "serde"
version = "1.0.130"
version = "1.0.131"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913"
checksum = "b4ad69dfbd3e45369132cc64e6748c2d65cdfb001a2b1c232d128b4ad60561c1"
[[package]]
name = "serde_cbor"
@ -1384,9 +1361,9 @@ dependencies = [
[[package]]
name = "serde_derive"
version = "1.0.130"
version = "1.0.131"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b"
checksum = "b710a83c4e0dff6a3d511946b95274ad9ca9e5d3ae497b63fda866ac955358d2"
dependencies = [
"proc-macro2",
"quote",
@ -1581,12 +1558,12 @@ dependencies = [
[[package]]
name = "time"
version = "0.1.43"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438"
checksum = "41effe7cfa8af36f439fac33861b66b049edc6f9a32331e2312660529c1c24ad"
dependencies = [
"itoa",
"libc",
"winapi 0.3.9",
]
[[package]]

@ -6,6 +6,7 @@ Oxigraph
[![PyPI](https://img.shields.io/pypi/v/pyoxigraph)](https://pypi.org/project/pyoxigraph/)
[![npm](https://img.shields.io/npm/v/oxigraph)](https://www.npmjs.com/package/oxigraph)
[![actions status](https://github.com/oxigraph/oxigraph/workflows/build/badge.svg)](https://github.com/oxigraph/oxigraph/actions)
[![dependency status](https://deps.rs/repo/github/oxigraph/oxigraph/status.svg)](https://deps.rs/repo/github/oxigraph/oxigraph)
[![Gitter](https://badges.gitter.im/oxigraph/community.svg)](https://gitter.im/oxigraph/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
Oxigraph is a graph database implementing the [SPARQL](https://www.w3.org/TR/sparql11-overview/) standard.

@ -14,7 +14,7 @@ publish = false
[dependencies]
anyhow = "1"
clap = "2"
chrono = "0.4"
time = { version = "0.3", features = ["formatting"] }
oxigraph = { version = "0.3.0-dev", path="../lib" }
text-diff = "0.4"

@ -1,8 +1,8 @@
use crate::manifest::Test;
use crate::report::TestResult;
use anyhow::{anyhow, Result};
use chrono::Utc;
use std::collections::HashMap;
use time::OffsetDateTime;
#[derive(Default)]
pub struct TestEvaluator {
@ -33,7 +33,7 @@ impl TestEvaluator {
Ok(TestResult {
test: test.id,
outcome,
date: Utc::now(),
date: OffsetDateTime::now_utc(),
})
})
.collect()

@ -1,14 +1,15 @@
use anyhow::Result;
use chrono::{DateTime, Utc};
use oxigraph::model::{Dataset, NamedNode};
use std::fmt::Write;
use text_diff::{diff, Difference};
use time::format_description::well_known::Rfc3339;
use time::OffsetDateTime;
#[derive(Debug)]
pub struct TestResult {
pub test: NamedNode,
pub outcome: Result<()>,
pub date: DateTime<Utc>,
pub date: OffsetDateTime,
}
pub fn dataset_diff(expected: &Dataset, actual: &Dataset) -> String {
@ -71,7 +72,7 @@ pub fn build_report(results: impl IntoIterator<Item = TestResult>) -> String {
writeln!(
&mut buffer,
"\tdc:issued \"{}\"^^xsd:dateTime ;",
Utc::now().to_rfc3339()
OffsetDateTime::now_utc().format(&Rfc3339).unwrap()
);
writeln!(
&mut buffer,
@ -140,7 +141,7 @@ pub fn build_report(results: impl IntoIterator<Item = TestResult>) -> String {
writeln!(
&mut buffer,
"\t\tdc:date \"{}\"^^xsd:dateTime",
result.date.to_rfc3339()
result.date.format(&Rfc3339).unwrap()
);
writeln!(&mut buffer, "\t] ;");
writeln!(&mut buffer, "\tearl:mode earl:automatic");

Loading…
Cancel
Save