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:945–962  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

943
944 #[test]
945 fn test_writer_output_line_simple() {
946 let buf: Vec<u8> = Vec::new();
947 let mut writer = Writer::new(buf);
948
949 let node = GraphNode {
950 change: NodeId::new(1),
951 start: ChangePosition::new(0),
952 end: ChangePosition::new(5),
953 };
954
955 let result: Result<(), std::io::Error> = writer.output_line(node, |buf| {
956 buf.copy_from_slice(b"hello");
957 Ok(())
958 });
959 result.unwrap();
960
961 assert_eq!(writer.into_inner(), b"hello");
962 }
963
964 #[test]
965 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