-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathversion.t
59 lines (48 loc) · 1.17 KB
/
version.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# vim:set ft= ts=4 sw=4 et fdm=marker:
use Test::Nginx::Socket::Lua 'no_plan';
use Cwd qw(cwd);
my $pwd = cwd();
my $use_luacov = $ENV{'TEST_NGINX_USE_LUACOV'} // '';
our $HttpConfig = qq{
lua_package_path "$pwd/lib/?.lua;$pwd/lib/?/init.lua;;";
init_by_lua_block {
if "1" == "$use_luacov" then
require 'luacov.tick'
jit.off()
end
}
};
run_tests();
__DATA__
=== TEST 1: Prints version text properly
--- http_config eval: $::HttpConfig
--- config
location =/t {
content_by_lua_block {
local version = require("resty.openssl.version")
ngx.say(version.version_text)
}
}
--- request
GET /t
--- response_body_like
OpenSSL \d.\d.\d.+
--- no_error_log
[error]
=== TEST 2: Prints version text using version()
--- http_config eval: $::HttpConfig
--- config
location =/t {
content_by_lua_block {
local version = require("resty.openssl.version")
ngx.say(version.version(version.VERSION))
ngx.say(version.version(version.CFLAGS))
}
}
--- request
GET /t
--- response_body_like
OpenSSL \d.\d.\d.+
compiler:.+
--- no_error_log
[error]