From ed52028907d845d373c185131ea319833d4a812d Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 19 Aug 2019 16:21:42 +0100 Subject: [Feature] Selectors: Add `specific_urls` extractor --- test/lua/unit/selectors.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/lua') diff --git a/test/lua/unit/selectors.lua b/test/lua/unit/selectors.lua index f1a06af30..924c94c48 100644 --- a/test/lua/unit/selectors.lua +++ b/test/lua/unit/selectors.lua @@ -151,6 +151,18 @@ context("Selectors test", function() selector = "emails", expect = {{"mailto://test@example.net"}}}, + ["specific_urls"] = { + selector = "specific_urls({limit = 1})", + expect = {{"http://example.net"}}}, + + ["specific_urls + emails"] = { + selector = "specific_urls({need_emails = true, limit = 2})", + expect = {{"http://example.net", "mailto://test@example.net"}}}, + + ["specific_urls + emails limit"] = { + selector = "specific_urls({need_emails = true, limit = 1})", + expect = {{"http://example.net"}}}, + ["pool_var str, default type"] = { selector = [[pool_var("str_var")]], expect = {"str 1"}}, -- cgit v1.2.3