tglman / persy
Showing 1 of 1 files from the diff.

@@ -320,6 +320,67 @@
Loading
320 320
    });
321 321
}
322 322
323 +
#[test]
324 +
fn test_multiple_put_same_value_intervalled_get() {
325 +
    create_and_drop_index("multiple_put same_value_gut", |persy, index_name| {
326 +
        let mut tx = persy.begin().expect("begin transaction works");
327 +
        tx.put::<u8, u8>(index_name, 10, 12).expect("put works correctly");
328 +
        let prep = tx.prepare().expect("prepare with index works");
329 +
        prep.commit().expect("commit with index works");
330 +
331 +
        let mut tx = persy.begin().expect("begin transaction works");
332 +
        tx.put::<u8, u8>(index_name, 10, 13).expect("put works correctly");
333 +
        let prep = tx.prepare().expect("prepare with index works");
334 +
        prep.commit().expect("commit with index works");
335 +
336 +
        let mut tx = persy.begin().expect("begin transaction works");
337 +
        tx.put::<u8, u8>(index_name, 10, 14).expect("put works correctly");
338 +
        let prep = tx.prepare().expect("prepare with index works");
339 +
        prep.commit().expect("commit with index works");
340 +
341 +
        let mut tx = persy.begin().expect("begin transaction works");
342 +
        tx.put::<u8, u8>(index_name, 10, 12).expect("put works correctly");
343 +
        let mut res = tx.get::<u8, u8>(index_name, &10).expect("get works correctly");
344 +
        assert_eq!(res.next(), Some(12));
345 +
        assert_eq!(res.next(), Some(13));
346 +
        assert_eq!(res.next(), Some(14));
347 +
        assert_eq!(res.next(), None);
348 +
        let prep = tx.prepare().expect("prepare with index works");
349 +
        prep.commit().expect("commit with index works");
350 +
351 +
        let mut res = persy.get::<u8, u8>(index_name, &10).expect("get works correctly");
352 +
        assert_eq!(res.next(), Some(12));
353 +
        assert_eq!(res.next(), Some(13));
354 +
        assert_eq!(res.next(), Some(14));
355 +
        assert_eq!(res.next(), None);
356 +
    });
357 +
}
358 +
359 +
#[test]
360 +
fn test_multiple_put_same_value_intervalled_get_same_tx() {
361 +
    create_and_drop_index("multiple_put same_value_gut", |persy, index_name| {
362 +
        let mut tx = persy.begin().expect("begin transaction works");
363 +
        tx.put::<u8, u8>(index_name, 10, 12).expect("put works correctly");
364 +
        tx.put::<u8, u8>(index_name, 10, 13).expect("put works correctly");
365 +
        tx.put::<u8, u8>(index_name, 10, 14).expect("put works correctly");
366 +
        tx.put::<u8, u8>(index_name, 10, 12).expect("put works correctly");
367 +
368 +
        let mut res = tx.get::<u8, u8>(index_name, &10).expect("get works correctly");
369 +
        assert_eq!(res.next(), Some(12));
370 +
        assert_eq!(res.next(), Some(13));
371 +
        assert_eq!(res.next(), Some(14));
372 +
        assert_eq!(res.next(), None);
373 +
        let prep = tx.prepare().expect("prepare with index works");
374 +
        prep.commit().expect("commit with index works");
375 +
376 +
        let mut res = persy.get::<u8, u8>(index_name, &10).expect("get works correctly");
377 +
        assert_eq!(res.next(), Some(12));
378 +
        assert_eq!(res.next(), Some(13));
379 +
        assert_eq!(res.next(), Some(14));
380 +
        assert_eq!(res.next(), None);
381 +
    });
382 +
}
383 +
323 384
#[test]
324 385
fn test_index_browse() {
325 386
    create_and_drop_index("test_index_browse", |persy, index_name| {
Files Coverage
src 91.32%
tests 98.63%
Project Totals (37 files) 92.69%
Notifications are pending CI completion. Waiting for GitLab's status webhook to queue notifications. Push notifications now.
1
coverage:
2
  status:
3
    project:
4
      default:
5
        target: 80%
6
        threshold: 1.0%
7
    patch: off
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading