From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 1391E25F4B for ; Mon, 16 Apr 2018 12:51:49 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pUtPXd_wtyoK for ; Mon, 16 Apr 2018 12:51:49 -0400 (EDT) Received: from smtp45.i.mail.ru (smtp45.i.mail.ru [94.100.177.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id C0A2D25EFF for ; Mon, 16 Apr 2018 12:51:48 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH v2 2/2] Fixed lost format on update and upsert operations. References: <1f4e0a5e-30f2-f36a-3970-ec4eeb14a456@tarantool.org> <4a4c5106-1d2d-553f-c8f1-5c031e91c9ac@tarantool.org> <8a909d97-3f64-207d-fe25-a4462f814d38@tarantool.org> From: Kirill Shcherbatov Message-ID: <0f5103aa-cbd6-8ccb-326d-51875e0f561d@tarantool.org> Date: Mon, 16 Apr 2018 19:51:46 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: "v.shpilevoy@tarantool.org" >From 84f2fc22124c2a2d1450de9b818f61c9c1cf31b0 Mon Sep 17 00:00:00 2001 From: Kirill Shcherbatov Date: Mon, 16 Apr 2018 19:50:04 +0300 Subject: [PATCH] New tests for invalid update and upsert --- test/engine/update.result | 10 ++++++++++ test/engine/update.test.lua | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/test/engine/update.result b/test/engine/update.result index 48398d2..0ae22ac 100644 --- a/test/engine/update.result +++ b/test/engine/update.result @@ -719,6 +719,11 @@ aa.VAL --- - ssss ... +-- invalid update +aa:update({{'=',2, 666}}) +--- +- error: 'Tuple field 2 type does not match one required by operation: expected string' +... -- test transform integrity aa:transform(-1, 1) --- @@ -741,6 +746,11 @@ box.space.tst_sample:get(2).VAL --- - wwwww2 ... +-- invalid upsert +s:upsert({2, 666}, {{'=', 2, 666}}) +--- +- error: 'Tuple field 2 type does not match one required by operation: expected string' +... s:drop() --- ... diff --git a/test/engine/update.test.lua b/test/engine/update.test.lua index c53e458..3ff7e62 100644 --- a/test/engine/update.test.lua +++ b/test/engine/update.test.lua @@ -108,6 +108,8 @@ aa = box.space.tst_sample:get(1) aa.VAL aa = aa:update({{'=',2,'ssss'}}) aa.VAL +-- invalid update +aa:update({{'=',2, 666}}) -- test transform integrity aa:transform(-1, 1) aa = nil @@ -116,5 +118,6 @@ s:upsert({2, 'wwwww'}, {{'=', 2, 'wwwww'}}) box.space.tst_sample:get(2).VAL s:upsert({2, 'wwwww2'}, {{'=', 2, 'wwwww2'}}) box.space.tst_sample:get(2).VAL - +-- invalid upsert +s:upsert({2, 666}, {{'=', 2, 666}}) s:drop() -- 2.7.4 On 16.04.2018 13:07, Vladislav Shpilevoy wrote: > Hello. Thanks for fixes. One more thing is left - please, > add tests on incorrect update and incorrect upsert, as I > asked you in two previous reviews. > > And in tests you does not need to do insert + get. Insert returns > the tuple, so you can do t = s:insert(), t:update/upsert ... > > On 16/04/2018 10:47, Kirill Shcherbatov wrote: >> I've fixed tests and wrong code style with tabs. >> >> From f9803f8d0b411abac02e35d5e4120ff0ce7e9341 Mon Sep 17 00:00:00 2001 >> From: Kirill Shcherbatov >> Date: Mon, 16 Apr 2018 10:44:10 +0300 >> Subject: [PATCH] Fixed tests and spaces >> >