MCPcopy Index your code
hub / github.com/endbasic/endbasic / test_read_sources_crlf_many_tests

Function test_read_sources_crlf_many_tests

core/tests/testutils/mod.rs:297–314  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

295
296#[test]
297fn test_read_sources_crlf_many_tests() -> io::Result<()> {
298 let mut file = NamedTempFile::new()?;
299 write!(
300 file,
301 "junk\r\n# Test: first\r\n\r\n## Source\r\n\r\n```basic\r\nOne\r\n```\r\n\r\n# Test: second\r\n\r\n## Source\r\n\r\n```basic\r\nTwo\r\n```\r\n"
302 )?;
303 file.flush()?;
304
305 assert_eq!(
306 [
307 Test { name: "first".to_owned(), sources: vec!["One".to_owned()] },
308 Test { name: "second".to_owned(), sources: vec!["Two".to_owned()] },
309 ],
310 read_sources(file.path())?.as_slice()
311 );
312
313 Ok(())
314}
315
316/// Collection of section markers for a golden file.
317struct Labels {

Callers

nothing calls this directly

Calls 1

flushMethod · 0.45

Tested by

no test coverage detected