Skip to content

Commit

Permalink
Add explicit test for wildcard.
Browse files Browse the repository at this point in the history
  • Loading branch information
b4hand committed Feb 12, 2018
1 parent 713577a commit 4de7d37
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test-agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ TEST(AgentTest, DisallowNone)
EXPECT_TRUE(agent.allowed("/anything"));
}

TEST(AgentTest, MiddleWildcard)
{
Rep::Agent agent = Rep::Agent("a.com").disallow("/test*foo");
EXPECT_FALSE(agent.allowed("/testfoo"));
EXPECT_FALSE(agent.allowed("/testafoo"));
EXPECT_FALSE(agent.allowed("/testaasdffoo"));
EXPECT_FALSE(agent.allowed("/test/foo"));
EXPECT_TRUE(agent.allowed("/testfo"));
EXPECT_TRUE(agent.allowed("/estfoo"));
}

TEST(AgentTest, EscapedRule)
{
Rep::Agent agent = Rep::Agent("a.com").disallow("/a%3cd.html");
Expand Down

0 comments on commit 4de7d37

Please sign in to comment.