From 3885d53a403352e36afc7d7d71d12d8ef7dbc88c Mon Sep 17 00:00:00 2001 From: Arnas Udovic Date: Thu, 18 Jul 2024 22:53:43 +0300 Subject: [PATCH] update test --- zordfsdb.go | 4 ++-- zordfsdb_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zordfsdb.go b/zordfsdb.go index de95d35..6cccf25 100644 --- a/zordfsdb.go +++ b/zordfsdb.go @@ -159,7 +159,7 @@ func (db *DB) Inc(vpath string) bool { val, found := db.Get(vpath) if !found { - return false + val = "0" } valAbc := abcex.Decode(val) @@ -181,7 +181,7 @@ func (db *DB) Dec(vpath string) bool { val, found := db.Get(vpath) if !found { - return false + val = "0" } valAbc := abcex.Decode(val) diff --git a/zordfsdb_test.go b/zordfsdb_test.go index bd5dca7..3786642 100644 --- a/zordfsdb_test.go +++ b/zordfsdb_test.go @@ -119,7 +119,7 @@ func TestNow(t *testing.T) { db.Now("today") val, found := db.Get("today") fmt.Println(val) - if !found || len(val) != 25 { + if !found || len(val) < 10 { t.Fatal("today value length wrong:", len(val)) } }