[Tarantool-patches] [PATCH v8 12/14] test: fix luacheck warnings W612, W613, W614 in test/sql-tap

Sergey Bronnikov sergeyb at tarantool.org
Fri Jan 29 19:23:44 MSK 2021


Thanks for review!

On 24.01.2021 20:36, Vladislav Shpilevoy wrote:
> Thanks for the patch!
>
> See 3 comments below.
>
> On 21.01.2021 13:50, sergeyb at tarantool.org wrote:
>> From: Sergey Bronnikov <sergeyb at tarantool.org>
>>
>> W612 (A line contains trailing whitespace)
>> W613 (Trailing whitespace in a string)
>> W614 (Trailing whitespace in a comment)
>>
>> Note: changes were made automatically in vim with regexp "%s/\s\+$//e".
>>
>> Part of #5464
>> ---
>> diff --git a/test/sql-tap/analyzeD.test.lua b/test/sql-tap/analyzeD.test.lua
>> index 12722a3d4..e0426b974 100755
>> --- a/test/sql-tap/analyzeD.test.lua
>> +++ b/test/sql-tap/analyzeD.test.lua
>> @@ -54,7 +54,7 @@ test:do_test(
>>   			ANALYZE;
>>   		]])
>>   	end, {
>> -        	-- <1.1>
>> +        	-- <1.1>
> 1. Git highligts this line with red. I assume here is an inconsistency
> between tabs and spaces. But it does not matter as these comments can
> be dropped. They are useless artifacts of TCL -> Lua translation.

Removed


--- a/test/sql-tap/analyzeD.test.lua
+++ b/test/sql-tap/analyzeD.test.lua
@@ -54,8 +54,6 @@ test:do_test(
                         ANALYZE;
                 ]])
         end, {
-               -- <1.1>
-               -- </1.1>
      })

  -- With full ANALYZE data, sql sees that c=150 (5 rows) is better than

>>           	-- </1.1>
>>       })
>> diff --git a/test/sql-tap/join.test.lua b/test/sql-tap/join.test.lua
>> index 1fc968307..4175608fd 100755
>> --- a/test/sql-tap/join.test.lua
>> +++ b/test/sql-tap/join.test.lua
>> @@ -564,6 +564,7 @@ test:do_catchsql_test(
>>           -- </join-3.4.2>
>>       })
>>   
>> +-- luacheck: ignore
> 2. Why? You couldn't delete some whitespaces here?
> Or what is the issue?
--- a/test/sql-tap/join.test.lua
+++ b/test/sql-tap/join.test.lua
@@ -564,11 +564,10 @@ test:do_catchsql_test(
          -- </join-3.4.2>
      })

--- luacheck: ignore
  test:do_catchsql_test(
      "join-3.5",
      [[
-        SELECT * FROM t1 USING(a)
+        SELECT * FROM t1 USING(a)
      ]], {
          -- <join-3.5>
          1, "Syntax error at line 1 at or near position 40: a JOIN 
clause is required before ON and USING"

>
>>   test:do_catchsql_test(
>>       "join-3.5",
>>       [[
>> diff --git a/test/sql-tap/tkt3935.test.lua b/test/sql-tap/tkt3935.test.lua
>> index 7138e9e6a..f3bbe0b9f 100755
>> --- a/test/sql-tap/tkt3935.test.lua
>> +++ b/test/sql-tap/tkt3935.test.lua
>> @@ -27,30 +27,31 @@ test:do_execsql_test(
>>           CREATE TABLE t2(c INT primary key, d INT);
>>       ]], {
>>           -- <tkt3935.1>
>> -
>> +
>>           -- </tkt3935.1>
>>       })
>>   
>>   test:do_execsql_test(
>>       "tkt3935.2",
>>       [[
>> -        SELECT j1.b FROM ( SELECT * FROM t1 INNER JOIN t2 ON a=c ) AS j1
>> +        SELECT j1.b FROM ( SELECT * FROM t1 INNER JOIN t2 ON a=c ) AS j1
>>       ]], {
>>           -- <tkt3935.2>
>> -
>> +
>>           -- </tkt3935.2>
>>       })
>>   
>>   test:do_execsql_test(
>>       "tkt3935.3",
>>       [[
>> -        SELECT j1.b FROM (t1 INNER JOIN t2 ON a=c) AS j1
>> +        SELECT j1.b FROM (t1 INNER JOIN t2 ON a=c) AS j1
>>       ]], {
>>           -- <tkt3935.3>
>> -
>> +
>>           -- </tkt3935.3>
>>       })
>>   
>> +-- luacheck: ignore
> 3. The same question as in the previous comment.

Fixed.


--- a/test/sql-tap/tkt3935.test.lua
+++ b/test/sql-tap/tkt3935.test.lua
@@ -51,77 +51,70 @@ test:do_execsql_test(
          -- </tkt3935.3>
      })

--- luacheck: ignore
  test:do_catchsql_test(
      "tkt3935.4",
      [[
-        SELECT a FROM (t1) AS t ON b USING(a)
+        SELECT a FROM (t1) AS t ON b USING(a)
      ]], {
          -- <tkt3935.4>
          1, "Syntax error at line 1 at or near position 52: a JOIN 
clause is required before ON and USING"
          -- </tkt3935.4>
      })

--- luacheck: ignore
  test:do_catchsql_test(
      "tkt3935.5",
      [[
-        SELECT a FROM (t1) AS t ON b
+        SELECT a FROM (t1) AS t ON b
      ]], {
          -- <tkt3935.5>
          1, "Syntax error at line 1 at or near position 43: a JOIN 
clause is required before ON and USING"
          -- </tkt3935.5>
      })

--- luacheck: ignore
  test:do_catchsql_test(
      "tkt3935.6",
      [[
-        SELECT a FROM (SELECT * FROM t1) AS t ON b USING(a)
+        SELECT a FROM (SELECT * FROM t1) AS t ON b USING(a)
      ]], {
          -- <tkt3935.6>
          1, "Syntax error at line 1 at or near position 66: a JOIN 
clause is required before ON and USING"
          -- </tkt3935.6>
      })

--- luacheck: ignore
  test:do_catchsql_test(
      "tkt3935.7",
      [[
-        SELECT a FROM (SELECT * FROM t1) AS t ON b
+        SELECT a FROM (SELECT * FROM t1) AS t ON b
      ]], {
          -- <tkt3935.7>
          1, "Syntax error at line 1 at or near position 57: a JOIN 
clause is required before ON and USING"
          -- </tkt3935.7>
      })

--- luacheck: ignore
  test:do_catchsql_test(
      "tkt3935.8",
      [[
-        SELECT a FROM t1 AS t ON b
+        SELECT a FROM t1 AS t ON b
      ]], {
          -- <tkt3935.8>
          1, "Syntax error at line 1 at or near position 41: a JOIN 
clause is required before ON and USING"
          -- </tkt3935.8>
      })


--- luacheck: ignore
  test:do_catchsql_test(
      "tkt3935.9",
      [[
-        SELECT a FROM t1 AS t ON b USING(a)
+        SELECT a FROM t1 AS t ON b USING(a)
      ]], {
          -- <tkt3935.9>
          1, "Syntax error at line 1 at or near position 50: a JOIN 
clause is required before ON and USING"
          -- </tkt3935.9>
      })

--- luacheck: ignore
  test:do_catchsql_test(
      "tkt3935.10",
      [[
-        SELECT a FROM t1 AS t USING(a)
+        SELECT a FROM t1 AS t USING(a)
      ]], {
          -- <tkt3935.10>
          1, "Syntax error at line 1 at or near position 45: a JOIN 
clause is required before ON and USING"

>
>>   test:do_catchsql_test(
>>       "tkt3935.4",
>>       [[


More information about the Tarantool-patches mailing list