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

Function test_read_sources_two

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

Source from the content-addressed store, hash-verified

189
190#[test]
191fn test_read_sources_two() -> io::Result<()> {
192 let mut file = NamedTempFile::new()?;
193 write!(
194 file,
195 "junk
196# Test: first
197
198## Source
199
200```basic
201First line
202
203Second line
204```
205
206## Disassembly
207
208```asm
209foo bar
210```
211
212# Test: second
213
214## Source
215
216```basic
217The line
218```
219"
220 )?;
221 file.flush()?;
222
223 assert_eq!(
224 [
225 Test {
226 name: "first".to_owned(),
227 sources: vec!["First line\n\nSecond line".to_owned()],
228 },
229 Test { name: "second".to_owned(), sources: vec!["The line".to_owned()] },
230 ],
231 read_sources(file.path())?.as_slice()
232 );
233
234 Ok(())
235}
236
237#[test]
238fn test_read_sources_many_sources_per_test() -> io::Result<()> {

Callers

nothing calls this directly

Calls 1

flushMethod · 0.45

Tested by

no test coverage detected