MCPcopy Create free account
hub / github.com/endbasic/endbasic / test_webdrive_put

Function test_webdrive_put

web/src/store.rs:468–484  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

466
467 #[wasm_bindgen_test]
468 async fn test_webdrive_put() {
469 let entry = Entry {
470 version: Entry::VERSION,
471 content: b"this is some content".to_vec(),
472 mtime: OffsetDateTime::from_unix_timestamp(1_234_567).unwrap(),
473 };
474
475 let mut webdrive = WebDrive::from_window();
476 webdrive.clock = Box::from(FakeClock { now: 1_234_567 });
477 webdrive.storage.clear().unwrap();
478 webdrive.put("code.bas", &entry.content).await.unwrap();
479
480 assert_eq!(
481 serde_json::to_string(&entry).unwrap(),
482 webdrive.storage.get("endbasic-program:CODE.BAS").unwrap().unwrap()
483 );
484 }
485
486 #[wasm_bindgen_test]
487 fn test_webdrive_system_path() {

Callers

nothing calls this directly

Calls 2

clearMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected