Skip to content

Commit 07fef50

Browse files
committed
Fixed interation tests. Fixed return types to only return a graph when requested
1 parent a498764 commit 07fef50

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub fn json_to_rdf(
4343
file_path: &String,
4444
namespace: &Option<String>,
4545
output_file: &Option<String>,
46-
) -> Result<Graph, Error> {
46+
) -> Result<Option<Graph>, Error> {
4747
let rdf_namespace: String = if namespace.is_some() {
4848
namespace.clone().unwrap()
4949
} else {
@@ -112,9 +112,9 @@ pub fn json_to_rdf(
112112
.expect("Error opening file");
113113

114114
writeln!(file, "{}", graph).expect("Error writing json2rdf data to file");
115-
Ok(graph)
115+
Ok(None)
116116
} else {
117-
return Ok(graph);
117+
return Ok(Some(graph));
118118
}
119119
}
120120

tests/integration_test.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ fn test_graph_triple_count() {
66

77
match triple_count_string {
88
Ok(res) => {
9-
println!("Graph created with {} triples", res.len());
10-
assert_eq!(res.len(), 23)
9+
assert_eq!(res.unwrap().len(), 23)
1110
}
1211
Err(e) => eprintln!("Error writing: {}", e),
1312
}

0 commit comments

Comments
 (0)