Skip to content

Commit

Permalink
Merge pull request #73 from vivki/main
Browse files Browse the repository at this point in the history
add unit test for js_periodic
  • Loading branch information
vivki authored Oct 11, 2023
2 parents badc29f + 3a98076 commit 6bf177f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion analyze_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func TestAnalyze_njs(t *testing.T) {
blockCtx{"http", "location"},
false,
},
"js_periodic not ok in http": {
"js_periodic not ok in http if": {
&Directive{
Directive: "js_periodic",
Args: []string{"function"},
Expand All @@ -252,6 +252,15 @@ func TestAnalyze_njs(t *testing.T) {
blockCtx{"stream", "server"},
false,
},
"js_periodic not ok in stream": {
&Directive{
Directive: "js_periodic",
Args: []string{"function"},
Line: 5,
},
blockCtx{"stream"},
true,
},
}

for name, tc := range testcases {
Expand Down

0 comments on commit 6bf177f

Please sign in to comment.