@@ -1953,7 +1953,7 @@ func TestAnalyze_lua(t *testing.T) {
1953
1953
Args : []string {"foo/bar.lua" },
1954
1954
Line : 5 ,
1955
1955
},
1956
- blockCtx {"server " },
1956
+ blockCtx {"http" , "location " },
1957
1957
false ,
1958
1958
},
1959
1959
"lua_shared_dict ok" : {
@@ -1998,16 +1998,16 @@ func TestAnalyze_lua(t *testing.T) {
1998
1998
Args : []string {"$res" , "' return 32 + math.cos(32) '" },
1999
1999
Line : 5 ,
2000
2000
},
2001
- blockCtx {"server" },
2001
+ blockCtx {"http" , " server" },
2002
2002
false ,
2003
2003
},
2004
- "set_by_lua not ok" : {
2004
+ "set_by_lua not ok no return value " : {
2005
2005
& Directive {
2006
2006
Directive : "set_by_lua" ,
2007
2007
Args : []string {"' return 32 + math.cos(32) '" },
2008
2008
Line : 5 ,
2009
2009
},
2010
- blockCtx {"http" },
2010
+ blockCtx {"http" , "server" },
2011
2011
true ,
2012
2012
},
2013
2013
"set_by_lua_block ok" : {
@@ -2016,25 +2016,25 @@ func TestAnalyze_lua(t *testing.T) {
2016
2016
Args : []string {"$res" , "{ return tonumber(ngx.var.foo) + 1 }" },
2017
2017
Line : 5 ,
2018
2018
},
2019
- blockCtx {"server" },
2019
+ blockCtx {"http" , " server" },
2020
2020
false ,
2021
2021
},
2022
- "set_by_lua_block not ok" : {
2022
+ "set_by_lua_block not ok no return value " : {
2023
2023
& Directive {
2024
2024
Directive : "set_by_lua_block" ,
2025
2025
Args : []string {"{ return tonumber(ngx.var.foo) + 1 }" },
2026
2026
Line : 5 ,
2027
2027
},
2028
- blockCtx {"http" },
2029
- true ,
2028
+ blockCtx {"http" , "server" },
2029
+ false ,
2030
2030
},
2031
2031
"content_by_lua ok" : {
2032
2032
& Directive {
2033
2033
Directive : "content_by_lua" ,
2034
2034
Args : []string {"'ngx.say('I need no extra escaping here, for example: \r \n blah')'" },
2035
2035
Line : 5 ,
2036
2036
},
2037
- blockCtx {"location" },
2037
+ blockCtx {"http" , " location" },
2038
2038
false ,
2039
2039
},
2040
2040
"content_by_lua not ok" : {
@@ -2043,7 +2043,7 @@ func TestAnalyze_lua(t *testing.T) {
2043
2043
Args : []string {"'ngx.say('I need no extra escaping here, for example: \r \n blah')'" },
2044
2044
Line : 5 ,
2045
2045
},
2046
- blockCtx {"http" },
2046
+ blockCtx {"http" , "location" },
2047
2047
true ,
2048
2048
},
2049
2049
"content_by_lua_block ok" : {
@@ -2052,7 +2052,7 @@ func TestAnalyze_lua(t *testing.T) {
2052
2052
Args : []string {"{ngx.say('I need no extra escaping here, for example: \r \n blah')}" },
2053
2053
Line : 5 ,
2054
2054
},
2055
- blockCtx {"location" },
2055
+ blockCtx {"http" , "server" , " location" },
2056
2056
false ,
2057
2057
},
2058
2058
"content_by_lua_block not ok" : {
@@ -2061,7 +2061,7 @@ func TestAnalyze_lua(t *testing.T) {
2061
2061
Args : []string {"{ngx.say('I need no extra escaping here, for example: \r \n blah')}" },
2062
2062
Line : 5 ,
2063
2063
},
2064
- blockCtx {"http" },
2064
+ blockCtx {"http" , "location" },
2065
2065
true ,
2066
2066
},
2067
2067
}
0 commit comments