public void SucceedsWithNoItems() { var parser = new UnorderedParser <string>(UnorderedParsingMode.AnySubset, a, b, c, d); parser.Parses(Tokenize("")) .ParsedValue .ShouldBe(new string[4]); }
public void SucceedsWithNoKnownItemsSeparated() { var parser = new UnorderedParser <string>(separator, UnorderedParsingMode.AnySubset, a, b, c, d); parser.Parses(Tokenize("X"), false) .ParsedValue .ShouldBe(new string[4]); }
public void ParsesNonemptySubsetsOfItemsSeparated() { var parser = new UnorderedParser <string>(separator, UnorderedParsingMode.NonemptySubset, a, b, c); foreach (var input in GetPermutationsSeparated("abc") .Concat(GetPermutationsSeparated("ab")) .Concat(GetPermutationsSeparated("bc")) .Concat(GetPermutationsSeparated("ac")) .Concat(GetPermutationsSeparated("a")) .Concat(GetPermutationsSeparated("b")) .Concat(GetPermutationsSeparated("c"))) { parser.Parses(Tokenize(input)); } }