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

Function test_sleep_real

std/src/datetime.rs:209–218  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

207
208 #[test]
209 fn test_sleep_real() {
210 let before = Instant::now();
211 let mut machine = MachineBuilder::default().build();
212 machine.compile(&mut "SLEEP 0.010".as_bytes()).unwrap();
213 match block_on(machine.exec()) {
214 Ok(None) => (),
215 r => panic!("Expected Ok(None) but got {:?}", r),
216 }
217 assert!(before.elapsed() >= Duration::from_millis(10));
218 }
219
220 #[test]
221 fn test_sleep_errors() {

Callers

nothing calls this directly

Calls 4

as_bytesMethod · 0.80
buildMethod · 0.45
compileMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected