diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-03-26 22:21:52 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-03-26 22:21:52 -0700 |
| commit | e7e86917202b805615a392a32244be4ea820efdb (patch) | |
| tree | a6d9f03d543d854ca85cad1155a52ab310558c5e | |
| parent | 86398d1efe28c1f0bf9929b5410a0a655defbc6c (diff) | |
| download | seaweedfs-e7e86917202b805615a392a32244be4ea820efdb.tar.xz seaweedfs-e7e86917202b805615a392a32244be4ea820efdb.zip | |
add some tests
| -rw-r--r-- | weed/filesys/dirty_page_interval_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/weed/filesys/dirty_page_interval_test.go b/weed/filesys/dirty_page_interval_test.go index 184be2f3b..ab3b37b7c 100644 --- a/weed/filesys/dirty_page_interval_test.go +++ b/weed/filesys/dirty_page_interval_test.go @@ -35,6 +35,23 @@ func TestContinuousIntervals_AddIntervalFullOverwrite(t *testing.T) { c := &ContinuousIntervals{} + // 1, + c.AddInterval(getBytes(1, 1), 0) + // _, 2, + c.AddInterval(getBytes(2, 1), 1) + // _, _, 3, 3, 3 + c.AddInterval(getBytes(3, 3), 2) + // _, _, _, 4, 4, 4 + c.AddInterval(getBytes(4, 3), 3) + + expectedData(t, c, 0, 1, 2, 3, 4, 4, 4) + +} + +func TestContinuousIntervals_RealCase1(t *testing.T) { + + c := &ContinuousIntervals{} + // 25, c.AddInterval(getBytes(25, 1), 0) // _, _, _, _, 23, 23 |
