depth: make constructor explicit

This commit is contained in:
Justin Viiret
2017-03-30 16:33:11 +11:00
committed by Matthew Barr
parent 37cb93e60f
commit cf82924a39
17 changed files with 248 additions and 221 deletions

View File

@@ -52,26 +52,26 @@ struct WidthTest {
class NFAWidthTest : public TestWithParam<WidthTest> { };
static const WidthTest widthTests[] = {
{ "()", 0, 0 },
{ "a", 1, 1 },
{ "a?b", 1, 2 },
{ "foobar", 6, 6 },
{ "foo(bar)?", 3, 6 },
{ "(a|ab|abc|abcd)", 1, 4 },
{ "foo.*bar", 6, depth::infinity() },
{ "foo(bar)*", 3, depth::infinity() },
{ "foo(bar)+", 6, depth::infinity() },
{ "foo(bar){1,3}", 6, 12 },
{ "(abcd)+", 4, depth::infinity() },
{ "foo\\z", 3, 3 },
{ "^foo", 3, 3 },
{ "^foo|bar.*baz", 3, depth::infinity() },
{ "^foobar.*|baz", 3, depth::infinity() },
{ "foo(\\z|bar)", 3, 6 },
{ "foo(|bar\\z)", 3, 6 },
{ "foo.{0,15}bar", 6, 21 },
{ "foo.{0,15}.*bar", 6, depth::infinity() },
{ "(?smi)^(aa[^a]aa$|a|a+\\Z|a)", 1, depth::infinity() }
{ "()", depth(0), depth(0) },
{ "a", depth(1), depth(1) },
{ "a?b", depth(1), depth(2) },
{ "foobar", depth(6), depth(6) },
{ "foo(bar)?", depth(3), depth(6) },
{ "(a|ab|abc|abcd)", depth(1), depth(4) },
{ "foo.*bar", depth(6), depth::infinity() },
{ "foo(bar)*", depth(3), depth::infinity() },
{ "foo(bar)+", depth(6), depth::infinity() },
{ "foo(bar){1,3}", depth(6), depth(12) },
{ "(abcd)+", depth(4), depth::infinity() },
{ "foo\\z", depth(3), depth(3) },
{ "^foo", depth(3), depth(3) },
{ "^foo|bar.*baz", depth(3), depth::infinity() },
{ "^foobar.*|baz", depth(3), depth::infinity() },
{ "foo(\\z|bar)", depth(3), depth(6) },
{ "foo(|bar\\z)", depth(3), depth(6) },
{ "foo.{0,15}bar", depth(6), depth(21) },
{ "foo.{0,15}.*bar", depth(6), depth::infinity() },
{ "(?smi)^(aa[^a]aa$|a|a+\\Z|a)", depth(1), depth::infinity() }
};
INSTANTIATE_TEST_CASE_P(NFAWidth, NFAWidthTest, ValuesIn(widthTests));