MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_writer_output_line_simple

Function test_writer_output_line_simple

atomic-core/src/output/traits.rs:966–983  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

964
965 #[test]
966 fn test_writer_output_line_simple() {
967 let buf: Vec<u8> = Vec::new();
968 let mut writer = Writer::new(buf);
969
970 let node = GraphNode {
971 change: NodeId::new(1),
972 start: ChangePosition::new(0),
973 end: ChangePosition::new(5),
974 };
975
976 let result: Result<(), std::io::Error> = writer.output_line(node, |buf| {
977 buf.copy_from_slice(b"hello");
978 Ok(())
979 });
980 result.unwrap();
981
982 assert_eq!(writer.into_inner(), b"hello");
983 }
984
985 #[test]
986 fn test_writer_output_line_with_newline() {

Callers

nothing calls this directly

Calls 2

output_lineMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected