#![cfg(feature = "nt")] use objio::ObjectWriter; use rdftk_io::nt::NTripleWriter; mod common; #[test] fn write_to_ntriples() { let graph = common::tony_benn_graph(common::TonyBennType::OneType); let writer = NTripleWriter::default(); let result = writer.write_to_string(&graph); assert!(result.is_ok()); let output = result.unwrap(); println!("# format: N-Triples\n{}", output); assert!(output.contains(" \"Tony Benn\" .\n")); assert!(output.contains(" \"Wikipedia\" .\n")); assert!(output.contains(" _:B1 .\n")); assert!(output.contains("_:B1 \"Tony Benn\" .\n")); assert!(output.contains("_:B1 .\n")); }