ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject incubator-ponymail git commit: Easier to distinguish files if they start differently
Date Thu, 17 Nov 2016 15:44:33 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master fabbee96a -> 169710aa6


Easier to distinguish files if they start differently

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/169710aa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/169710aa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/169710aa

Branch: refs/heads/master
Commit: 169710aa68710c9a28e9427b34b5e93161c212a4
Parents: fabbee9
Author: Sebb <sebb@apache.org>
Authored: Thu Nov 17 15:44:17 2016 +0000
Committer: Sebb <sebb@apache.org>
Committed: Thu Nov 17 15:44:17 2016 +0000

----------------------------------------------------------------------
 test/luasocket_test.lua | 68 ++++++++++++++++++++++++++++++++++++++++++++
 test/test_luasocket.lua | 68 --------------------------------------------
 2 files changed, 68 insertions(+), 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/169710aa/test/luasocket_test.lua
----------------------------------------------------------------------
diff --git a/test/luasocket_test.lua b/test/luasocket_test.lua
new file mode 100644
index 0000000..614cbbf
--- /dev/null
+++ b/test/luasocket_test.lua
@@ -0,0 +1,68 @@
+--[[
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+]]--
+
+-- Test script for http.socket showing different response types
+
+local http = require 'socket.http'
+
+--[[
+    The luasock library is documented at:
+    http://w3.impa.br/~diego/software/luasocket/http.html#request
+    This gives the following information on the returned values:
+
+    #: On Success        On Failure
+    1: body (string)     nil
+    2: code (number)     message (string)
+    3: headers (table)   nil
+    4: status line       nil
+
+]]--
+
+function runRequest(url, query)
+    print("=========", url, query)
+    local response = {http.request(url, query)} -- pick up all the response
+    print("#values: ",#response)
+    for i = 1,#response do
+        local v = response[i]
+        if i == 2 or i == 4 then
+            print(i,type(v),v)
+        else
+            print(i,type(v),#(v or ""))
+            if i == 3 and type(v) == "table" then
+                for k,v in pairs(v) do
+                    print("",k,v)
+                end
+            end
+            if i == 1 and v then
+                print(v:sub(1,math.min(132,#v)))
+            end
+        end
+    end
+    local hc = response[2]
+    if hc ~= 200 then -- show the error message
+        print(response[1])
+    end
+end
+
+
+if #arg >0 then
+    runRequest(unpack(arg))
+else
+    runRequest("http://localhost:9200/_cat/indices") -- valid
+    runRequest("http://localhost:9200/_dog/indices") -- invalid
+    runRequest("http://localhost:92000/_cat/indices") -- port invalid
+end

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/169710aa/test/test_luasocket.lua
----------------------------------------------------------------------
diff --git a/test/test_luasocket.lua b/test/test_luasocket.lua
deleted file mode 100644
index 614cbbf..0000000
--- a/test/test_luasocket.lua
+++ /dev/null
@@ -1,68 +0,0 @@
---[[
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-]]--
-
--- Test script for http.socket showing different response types
-
-local http = require 'socket.http'
-
---[[
-    The luasock library is documented at:
-    http://w3.impa.br/~diego/software/luasocket/http.html#request
-    This gives the following information on the returned values:
-
-    #: On Success        On Failure
-    1: body (string)     nil
-    2: code (number)     message (string)
-    3: headers (table)   nil
-    4: status line       nil
-
-]]--
-
-function runRequest(url, query)
-    print("=========", url, query)
-    local response = {http.request(url, query)} -- pick up all the response
-    print("#values: ",#response)
-    for i = 1,#response do
-        local v = response[i]
-        if i == 2 or i == 4 then
-            print(i,type(v),v)
-        else
-            print(i,type(v),#(v or ""))
-            if i == 3 and type(v) == "table" then
-                for k,v in pairs(v) do
-                    print("",k,v)
-                end
-            end
-            if i == 1 and v then
-                print(v:sub(1,math.min(132,#v)))
-            end
-        end
-    end
-    local hc = response[2]
-    if hc ~= 200 then -- show the error message
-        print(response[1])
-    end
-end
-
-
-if #arg >0 then
-    runRequest(unpack(arg))
-else
-    runRequest("http://localhost:9200/_cat/indices") -- valid
-    runRequest("http://localhost:9200/_dog/indices") -- invalid
-    runRequest("http://localhost:92000/_cat/indices") -- port invalid
-end


Mime
View raw message