From 3fb505671b898cb1c4cd1b09e68b0216e04839b8 Mon Sep 17 00:00:00 2001 From: nobonobo Date: Wed, 27 Nov 2013 09:03:38 +0900 Subject: [PATCH] lib func test added. --- unqlite.go | 3 +-- unqlite_test.go | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/unqlite.go b/unqlite.go index f2f86ef..b6bc21f 100644 --- a/unqlite.go +++ b/unqlite.go @@ -8,7 +8,6 @@ package unqlitego import "C" import ( - "errors" "fmt" "runtime" "unsafe" @@ -299,8 +298,8 @@ func Shutdown() (err error) { res := C.unqlite_lib_shutdown() if res != C.UNQLITE_OK { err = UnQLiteError(res) - return } + return } // IsThreadSafe ... diff --git a/unqlite_test.go b/unqlite_test.go index 09aeba0..b375557 100644 --- a/unqlite_test.go +++ b/unqlite_test.go @@ -8,6 +8,28 @@ import ( "testing" ) +func Testライブラリ(t *testing.T) { + Describe(t, "正常系", func() { + Context("基本テスト", func() { + It("IsThreadSafe", func() { + Expect(IsThreadSafe()).To(Equal, true) + }) + It("Version", func() { + Expect(Version()).To(Equal, "1.1.6") + }) + It("Signature", func() { + Expect(Signature()).To(Equal, "unqlite/1.1.6") + }) + It("Ident", func() { + Expect(Ident()).To(Equal, "unqlite:b172a1e2c3f62fb35c8e1fb2795121f82356cad6") + }) + It("Copyright", func() { + Expect(Copyright()).To(Equal, "Copyright (C) Symisc Systems, S.U.A.R.L [Mrad Chems Eddine ] 2012-2013, http://unqlite.org/") + }) + }) + }) +} + func Testモジュール(t *testing.T) { var db *Database var src []byte