aboutsummaryrefslogtreecommitdiff
path: root/db_test.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-06-27 11:40:46 -0600
committerBen Johnson <benbjohnson@yahoo.com>2014-06-27 11:40:46 -0600
commite4ad031878e4503dc2bd931accc4fdcc6215efcc (patch)
tree73df1db1cc49f25cef36eb876758bcd818fd8e2a /db_test.go
parentMinor fix. (diff)
parentCopy the free pages stats from the receiver (diff)
downloaddedo-e4ad031878e4503dc2bd931accc4fdcc6215efcc.tar.gz
dedo-e4ad031878e4503dc2bd931accc4fdcc6215efcc.tar.xz
Merge pull request #214 from Shopify/fix_stats_sub
Copy the free pages stats from the receiver
Diffstat (limited to 'db_test.go')
-rw-r--r--db_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/db_test.go b/db_test.go
index 310dfad..e689836 100644
--- a/db_test.go
+++ b/db_test.go
@@ -354,9 +354,13 @@ func TestDB_String(t *testing.T) {
func TestDBStats_Sub(t *testing.T) {
var a, b Stats
a.TxStats.PageCount = 3
+ a.FreePageN = 4
b.TxStats.PageCount = 10
+ b.FreePageN = 14
diff := b.Sub(&a)
assert.Equal(t, 7, diff.TxStats.PageCount)
+ // free page stats are copied from the receiver and not subtracted
+ assert.Equal(t, 14, diff.FreePageN)
}
// Ensure that meta with bad magic is invalid.