From 89d771929adec128423ee51ff403d99f73f13b15 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Thu, 20 Apr 2017 18:52:02 +0800 Subject: [PATCH] add print in testmongodb --- test/testmongodb.lua | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/test/testmongodb.lua b/test/testmongodb.lua index e8dc5887..06e2691c 100644 --- a/test/testmongodb.lua +++ b/test/testmongodb.lua @@ -7,18 +7,10 @@ local host, db_name = ... function test_insert_without_index() local db = mongo.client({host = host}) - - local r = db:runCommand("buildInfo",1) - for k, v in pairs(r) do - print(k,v) - end db[db_name].testdb:dropIndex("*") db[db_name].testdb:drop() local ret = db[db_name].testdb:safe_insert({test_key = 1}); - for k,v in pairs(ret) do - print(k,v) - end assert(ret and ret.n == 1) local ret = db[db_name].testdb:safe_insert({test_key = 1}); @@ -92,7 +84,7 @@ function test_expire_index() assert(ret and ret.test_key == 1) for i = 1, 1000 do - skynet.sleep(11); + skynet.sleep(1); local ret = db[db_name].testdb:findOne({test_key = 1}) if ret == nil then @@ -104,10 +96,13 @@ function test_expire_index() end skynet.start(function() + print("Test insert without index") test_insert_without_index() + print("Test insert index") test_insert_with_index() + print("Test find and remove") test_find_and_remove() + print("Test expire index") test_expire_index() - print("mongodb test finish."); end)