Comparison

mod_firewall/test.lib.lua @ 2807:2c3334131a7d

mod_firewall/test: Trim trailing whitespace [luacheck]
author Kim Alvefur <zash@zash.se>
date Fri, 20 Oct 2017 02:52:58 +0200
parent 2806:93a4b13ca9f6
child 2808:2cc02ee82e8c
comparison
equal deleted inserted replaced
2806:93a4b13ca9f6 2807:2c3334131a7d
27 local stats_dropped, stats_passed = 0, 0; 27 local stats_dropped, stats_passed = 0, 0;
28 28
29 load_unload_scripts(set.new(arg)); 29 load_unload_scripts(set.new(arg));
30 local session = { notopen = true }; 30 local session = { notopen = true };
31 local stream_callbacks = { default_ns = "jabber:client" }; 31 local stream_callbacks = { default_ns = "jabber:client" };
32 32
33 function stream_callbacks.streamopened(session) 33 function stream_callbacks.streamopened(session)
34 session.notopen = nil; 34 session.notopen = nil;
35 end 35 end
36 function stream_callbacks.streamclosed() 36 function stream_callbacks.streamclosed()
37 end 37 end
46 print(""); 46 print("");
47 else 47 else
48 stats_dropped = stats_dropped + 1; 48 stats_dropped = stats_dropped + 1;
49 end 49 end
50 end 50 end
51 51
52 local stream = xmppstream.new(session, stream_callbacks); 52 local stream = xmppstream.new(session, stream_callbacks);
53 stream:feed("<stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client'>"); 53 stream:feed("<stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client'>");
54 local line_count = 0; 54 local line_count = 0;
55 for line in io.lines() do 55 for line in io.lines() do
56 line_count = line_count + 1; 56 line_count = line_count + 1;
58 if not ok then 58 if not ok then
59 stderr("Fatal XML parse error on line "..line_count..": "..err); 59 stderr("Fatal XML parse error on line "..line_count..": "..err);
60 return 1; 60 return 1;
61 end 61 end
62 end 62 end
63 63
64 stderr("Summary"); 64 stderr("Summary");
65 stderr("-------"); 65 stderr("-------");
66 stderr(""); 66 stderr("");
67 stderr(stats_dropped + stats_passed, "processed"); 67 stderr(stats_dropped + stats_passed, "processed");
68 stderr(stats_passed, "passed"); 68 stderr(stats_passed, "passed");